Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson 2023-07-21 10:46:48 +08:00
commit 8a4f990214
3 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import (
// fs_product_recommend 推荐商品表
type FsProductRecommend struct {
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
ProductId *int64 `gorm:"unique_key;default:0;" json:"product_id"` // 产品ID
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品ID
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0不正常
Category *int64 `gorm:"default:1;" json:"category"` // 推荐类别1:详情推荐 2:列表页推荐
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间

View File

@ -8,6 +8,7 @@ import (
type FsProductSize struct {
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
IsPopular *int64 `gorm:"default:0;" json:"is_popular"` // 是否受欢迎 0否1是
Title *string `gorm:"default:'';" json:"title"` // 标题 10*10*20
Cover *string `gorm:"default:'';" json:"cover"` //
CoverImg *string `gorm:"default:'';" json:"cover_img"` //

View File

@ -46,7 +46,7 @@ func (l *GetSizeByPidLogic) GetSizeByPid(req *types.GetSizeByPidReq, userinfo *a
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get product info")
}
//获取产品尺寸列表(需要正序排序)
sizeList, err := l.svcCtx.AllModels.FsProductSize.GetAllByProductIds(l.ctx, []int64{productInfo.Id}, "sort ASC")
sizeList, err := l.svcCtx.AllModels.FsProductSize.GetAllByProductIds(l.ctx, []int64{productInfo.Id}, "is_popular DESC,sort ASC")
if err != nil {
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get size list")