- 重构dao.store_sku中的命名

This commit is contained in:
gazebo
2019-05-25 11:35:03 +08:00
parent c00fc49f68
commit f3706f1abe
4 changed files with 16 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/business/partner"
)
@@ -186,7 +187,7 @@ func (c *PurchaseHandler) Map2Order(orderData map[string]interface{}) (order *mo
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["price"])),
Weight: int(math.Round(utils.Interface2Float64WithDefault(product["weight"], 0.0))),
}
if sku.VendorSkuID == "0" {
if dao.IsVendorThingIDEmpty(sku.VendorSkuID) {
sku.VendorSkuID = utils.Int64ToStr(utils.MustInterface2Int64(product["id"])) // 2018-09-28日饿了么迁移到饿百后这个字段发生了变化
}
order.Skus = append(order.Skus, sku)

View File

@@ -175,7 +175,7 @@ func (p *PurchaseHandler) SyncLocalStoreCategory(ctx *jxcontext.Context, db *dao
return "", err
}
} else {
if v.VendorCatID == "" || v.VendorCatID == "0" {
if dao.IsVendorThingIDEmpty(v.VendorCatID) {
num++
}
if isCheckRemote {

View File

@@ -129,7 +129,7 @@ func (p *PurchaseHandler) SyncLocalStoreCategory(ctx *jxcontext.Context, db *dao
return "", err
}
} else {
if (v.VendorCatID == "0" || v.VendorCatID == "") && ((v.CatSyncStatus & model.SyncFlagNewMask) == 0) {
if dao.IsVendorThingIDEmpty(v.VendorCatID) && ((v.StoreCatSyncStatus & model.SyncFlagNewMask) == 0) {
catMap := &model.StoreSkuCategoryMap{}
catMap.ID = v.MapID
if _, err = dao.UpdateEntityLogically(db, catMap, map[string]interface{}{