fix
This commit is contained in:
parent
50817d7ae2
commit
7e4708e8d8
@ -8,6 +8,7 @@ import (
|
|||||||
type FsProductModel3d struct {
|
type FsProductModel3d struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
|
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
|
||||||
|
IsPopular *int64 `gorm:"default:0;" json:"is_popular"` // 是否热门 0否 1是
|
||||||
Tag *int64 `gorm:"default:1;" json:"tag"` // 类别(1:模型,2:配件,3:场景)
|
Tag *int64 `gorm:"default:1;" json:"tag"` // 类别(1:模型,2:配件,3:场景)
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 标题
|
Title *string `gorm:"default:'';" json:"title"` // 标题
|
||||||
Name *string `gorm:"default:'';" json:"name"` // 详情页展示名称
|
Name *string `gorm:"default:'';" json:"name"` // 详情页展示名称
|
||||||
|
@ -73,7 +73,7 @@ func (l *GetFittingByPidLogic) GetFittingByPid(req *types.GetFittingByPidReq, us
|
|||||||
partIds = append(partIds, *v.PartId)
|
partIds = append(partIds, *v.PartId)
|
||||||
}
|
}
|
||||||
//获取配件数据
|
//获取配件数据
|
||||||
fittingList, err := l.svcCtx.AllModels.FsProductModel3d.GetAllByIds(l.ctx, partIds, "price ASC")
|
fittingList, err := l.svcCtx.AllModels.FsProductModel3d.GetAllByIds(l.ctx, partIds, "is_popular DESC,price ASC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get part list")
|
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get part list")
|
||||||
@ -110,6 +110,7 @@ func (l *GetFittingByPidLogic) GetFittingByPid(req *types.GetFittingByPidReq, us
|
|||||||
Title: *fitting.Title,
|
Title: *fitting.Title,
|
||||||
Price: *fitting.Price,
|
Price: *fitting.Price,
|
||||||
ModelInfo: modelInfo,
|
ModelInfo: modelInfo,
|
||||||
|
IsPopular: *fitting.IsPopular > 0,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", listRsp)
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", listRsp)
|
||||||
|
@ -82,6 +82,7 @@ func (l *GetSizeByPidLogic) GetSizeByPid(req *types.GetSizeByPidReq, userinfo *a
|
|||||||
Cover: *sizeInfo.Cover,
|
Cover: *sizeInfo.Cover,
|
||||||
PartsCanDeleted: *sizeInfo.PartsCanDeleted > 0,
|
PartsCanDeleted: *sizeInfo.PartsCanDeleted > 0,
|
||||||
ModelId: modelList[modelIndex].Id,
|
ModelId: modelList[modelIndex].Id,
|
||||||
|
IsPopular: *sizeInfo.IsPopular > 0,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", listRsp)
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", listRsp)
|
||||||
|
@ -334,6 +334,7 @@ type GetSizeByPidRsp struct {
|
|||||||
Cover string `json:"cover"` //缩略图
|
Cover string `json:"cover"` //缩略图
|
||||||
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
|
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
|
||||||
ModelId int64 `json:"model_id"` //产品主模型id
|
ModelId int64 `json:"model_id"` //产品主模型id
|
||||||
|
IsPopular bool `json:"is_popular"` //是否受欢迎
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetTemplateByPidReq struct {
|
type GetTemplateByPidReq struct {
|
||||||
@ -350,6 +351,7 @@ type GetFittingByPidRsp struct {
|
|||||||
MaterialImg string `json:"material_img"`
|
MaterialImg string `json:"material_img"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Price int64 `json:"price"`
|
Price int64 `json:"price"`
|
||||||
|
IsPopular bool `json:"is_popular"`
|
||||||
ModelInfo interface{} `json:"model_info"`
|
ModelInfo interface{} `json:"model_info"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +379,7 @@ type GetSizeByPidRsp {
|
|||||||
Cover string `json:"cover"` //缩略图
|
Cover string `json:"cover"` //缩略图
|
||||||
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
|
PartsCanDeleted bool `json:"parts_can_deleted"` //用户可否删除配件
|
||||||
ModelId int64 `json:"model_id"` //产品主模型id
|
ModelId int64 `json:"model_id"` //产品主模型id
|
||||||
|
IsPopular bool `json:"is_popular"` //是否受欢迎
|
||||||
}
|
}
|
||||||
//获取产品模板列表
|
//获取产品模板列表
|
||||||
type GetTemplateByPidReq {
|
type GetTemplateByPidReq {
|
||||||
@ -394,6 +395,7 @@ type GetFittingByPidRsp {
|
|||||||
MaterialImg string `json:"material_img"`
|
MaterialImg string `json:"material_img"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Price int64 `json:"price"`
|
Price int64 `json:"price"`
|
||||||
|
IsPopular bool `json:"is_popular"`
|
||||||
ModelInfo interface{} `json:"model_info"`
|
ModelInfo interface{} `json:"model_info"`
|
||||||
}
|
}
|
||||||
//获取产品灯光数据
|
//获取产品灯光数据
|
||||||
|
Loading…
x
Reference in New Issue
Block a user