- 对于饿百,按价格倒序创建(这样价格低的商品应该在最前面)

- 对于美团外卖,以门店价格为其sequence
This commit is contained in:
gazebo
2019-05-23 21:05:06 +08:00
parent 284e92381c
commit 8b03dce5da
3 changed files with 2 additions and 8 deletions

View File

@@ -56,7 +56,6 @@ type StoreSkuSyncInfo struct {
Unit string
Img string
Upc string
Seq int
DescImg string
VendorVendorCatID int64 `orm:"column(vendor_vendor_cat_id)"`
@@ -193,11 +192,6 @@ func GetStoreSkus(db *DaoDB, vendorID, storeID int, skuIDs []int) (skus []*Store
if err = GetRows(db, &skus, sql, sqlParams...); err != nil {
return nil, err
}
index := 1
for _, sku := range skus {
sku.Seq = index
index++
}
return skus, err
}

View File

@@ -117,7 +117,7 @@ func (p *PurchaseHandler) getDirtyStoreSkus(db *dao.DaoDB, storeID int, skuIDs [
sql += " AND t1.sku_id IN (" + dao.GenQuestionMarks(len(skuIDs)) + ")"
sqlParams = append(sqlParams, skuIDs)
}
sql += " ORDER BY t1.price"
sql += " ORDER BY t1.price DESC"
err = dao.GetRows(db, &storeSkuInfoList, sql, sqlParams...)
return storeSkuInfoList, err
}

View File

@@ -298,7 +298,7 @@ func (p *PurchaseHandler) SyncStoreSkus(ctx *jxcontext.Context, parentTask tasks
if skuItem.DescImg != "" {
foodData["picture_contents"] = skuItem.DescImg
}
foodData["sequence"] = skuItem.Seq
foodData["sequence"] = skuItem.Price
if skuItem.VendorVendorCatID != 0 {
foodData["tag_id"] = utils.Int64ToStr(skuItem.VendorVendorCatID)
} else {