畅销品查询修改
This commit is contained in:
@@ -2232,7 +2232,7 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
|||||||
skuNameAndPlace, err := dao.GetTopSkusByCityCode(db, cityCode, orderCreate)
|
skuNameAndPlace, err := dao.GetTopSkusByCityCode(db, cityCode, orderCreate)
|
||||||
if storeID > 0 {
|
if storeID > 0 {
|
||||||
var skuNameList []*model.SkuName
|
var skuNameList []*model.SkuName
|
||||||
//未关注,不可售的商品nameID列表
|
//不可售的商品nameID列表
|
||||||
sql := `
|
sql := `
|
||||||
SELECT DISTINCT b.name_id id,1 brand_id
|
SELECT DISTINCT b.name_id id,1 brand_id
|
||||||
FROM store_sku_bind a
|
FROM store_sku_bind a
|
||||||
@@ -2281,8 +2281,8 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
|||||||
v.Type = skuNameMap[v.ID].BrandID
|
v.Type = skuNameMap[v.ID].BrandID
|
||||||
skuList, _ := dao.GetSkus(db, nil, []int{v.ID}, nil, nil)
|
skuList, _ := dao.GetSkus(db, nil, []int{v.ID}, nil, nil)
|
||||||
v.Skus = skuList
|
v.Skus = skuList
|
||||||
var storeSkuNameExt []*dao.StoreSkuNameExt
|
|
||||||
for _, vv := range skuList {
|
for _, vv := range skuList {
|
||||||
|
var storeSkuNameExt []*dao.StoreSkuNameExt
|
||||||
var skusList []*dao.StoreSkuExt
|
var skusList []*dao.StoreSkuExt
|
||||||
skus := &dao.StoreSkuExt{
|
skus := &dao.StoreSkuExt{
|
||||||
SkuID: vv.ID,
|
SkuID: vv.ID,
|
||||||
@@ -2294,14 +2294,16 @@ func GetTopSkusByCityCode(ctx *jxcontext.Context, cityCode, storeID int) (skuNam
|
|||||||
skuNamesInfo := &dao.StoreSkuNamesInfo{
|
skuNamesInfo := &dao.StoreSkuNamesInfo{
|
||||||
SkuNames: storeSkuNameExt,
|
SkuNames: storeSkuNameExt,
|
||||||
}
|
}
|
||||||
|
storeSkuNameExt = append(storeSkuNameExt, storeSkuName)
|
||||||
dao.UpdateActPrice4StoreSkuNameNew(db, []int{storeID}, []int{vv.ID}, skuNamesInfo, -1)
|
dao.UpdateActPrice4StoreSkuNameNew(db, []int{storeID}, []int{vv.ID}, skuNamesInfo, -1)
|
||||||
vv.StoreSkuStatus = model.StoreSkuBindStatusDontSale
|
vv.StoreSkuStatus = model.StoreSkuBindStatusDontSale
|
||||||
// vv.ActPrice = skuNamesInfo.SkuNames[0].Skus[0].ActPrice
|
if skuNamesInfo.SkuNames[0].Skus[0] != nil {
|
||||||
// vv.ActID = skuNamesInfo.SkuNames[0].Skus[0].ActID
|
vv.ActPrice = skuNamesInfo.SkuNames[0].Skus[0].ActPrice
|
||||||
// vv.ActType = skuNamesInfo.SkuNames[0].Skus[0].ActType
|
vv.ActID = skuNamesInfo.SkuNames[0].Skus[0].ActID
|
||||||
// vv.EarningPrice = skuNamesInfo.SkuNames[0].Skus[0].EarningPrice
|
vv.ActType = skuNamesInfo.SkuNames[0].Skus[0].ActType
|
||||||
// vv.EarningActID = skuNamesInfo.SkuNames[0].Skus[0].EarningActID
|
vv.EarningPrice = skuNamesInfo.SkuNames[0].Skus[0].EarningPrice
|
||||||
storeSkuNameExt = append(storeSkuNameExt, storeSkuName)
|
vv.EarningActID = skuNamesInfo.SkuNames[0].Skus[0].EarningActID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
skuNameAndPlaceList = append(skuNameAndPlaceList, v)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,18 +231,18 @@ type Sku struct {
|
|||||||
|
|
||||||
type SkuAndName struct {
|
type SkuAndName struct {
|
||||||
Sku
|
Sku
|
||||||
Name string
|
Name string `json:"name"`
|
||||||
Unit string
|
Unit string `json:"unit"`
|
||||||
Prefix string
|
Prefix string `json:"prefix"`
|
||||||
IsSpu int
|
IsSpu int `json:"isSpu"`
|
||||||
ExPrefix string
|
ExPrefix string `json:"exPrefix"`
|
||||||
ExPrefixBegin *time.Time
|
ExPrefixBegin *time.Time `json:"exPrefixBegin"`
|
||||||
ExPrefixEnd *time.Time
|
ExPrefixEnd *time.Time `json:"eExPrefixEndxPrefixEnd"`
|
||||||
Price int
|
Price int `json:"price"`
|
||||||
StoreSkuStatus int
|
StoreSkuStatus int `json:"storeSkuStatus"`
|
||||||
ActPrice int `json:"actPrice"`
|
ActPrice int `json:"actPrice"`
|
||||||
ActID int `orm:"column(act_id)" json:"actID"`
|
ActID int `orm:"column(act_id)" json:"actID"`
|
||||||
ActType int `orm:"column(act_type)" json:"actType"`
|
ActType int `orm:"column(act_type)" json:"actType"`
|
||||||
|
|
||||||
EarningPrice int `json:"earningPrice"`
|
EarningPrice int `json:"earningPrice"`
|
||||||
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
|
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
|
||||||
|
|||||||
Reference in New Issue
Block a user