畅销商品
This commit is contained in:
@@ -2190,7 +2190,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
var skuNameList []*model.SkuName
|
||||
//未关注,不可售的商品nameID列表
|
||||
sql := `
|
||||
SELECT DISTINCT b.name_id id
|
||||
SELECT DISTINCT b.name_id id,1 brand_id
|
||||
FROM store_sku_bind a
|
||||
JOIN sku b ON a.sku_id = b.id AND b.deleted_at = ?
|
||||
WHERE a.deleted_at = ?
|
||||
@@ -2203,7 +2203,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
AND a.store_id = ?
|
||||
AND a.status = ?)
|
||||
UNION
|
||||
SELECT DISTINCT a.name_id id
|
||||
SELECT DISTINCT a.name_id id,0 brand_id
|
||||
FROM sku a
|
||||
LEFT JOIN (SELECT DISTINCT b.name_id
|
||||
FROM store_sku_bind a
|
||||
@@ -2235,6 +2235,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
||||
}
|
||||
for _, v := range skuNameAndPlace {
|
||||
if skuNameMap[v.ID] != nil {
|
||||
v.Type = v.BrandID
|
||||
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ type SkuNameAndPlace struct {
|
||||
CityName string `json:"cityName"`
|
||||
Sequence int `json:"sequence"`
|
||||
Count int `json:"count"`
|
||||
Type int `json:"type"`
|
||||
}
|
||||
|
||||
// todo 应该通过需要同步的skuid来驱动同步分类,而不是当前这种分开的逻辑
|
||||
|
||||
Reference in New Issue
Block a user