- 美团同步商品时添加sequence

This commit is contained in:
gazebo
2019-04-16 17:36:07 +08:00
parent 0f871847e9
commit be0ab44158
2 changed files with 7 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ type StoreSkuSyncInfo struct {
Unit string
Img string
Upc string
Seq int
VendorVendorCatID int64 `orm:"column(vendor_vendor_cat_id)"`
@@ -171,6 +172,11 @@ func GetStoreSkus(db *DaoDB, vendorID, storeID int, skuIDs []int) (skus []*Store
sql += " ORDER BY t1.price"
// globals.SugarLogger.Debug(sql)
if err = GetRows(db, &skus, sql, sqlParams...); err != nil {
index := 1
for _, sku := range skus {
sku.Seq = index
index++
}
return nil, err
}
return skus, err