From ff4b6098d7af2d29c44c097f03dd3787343bf549 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 15 Jul 2019 17:05:58 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=8E=BB=E9=99=A4=E5=87=A0=E4=B8=AA?= =?UTF-8?q?=E8=AF=AF=E7=94=A8ZeroTimeValue=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/act/act.go | 4 ++-- business/jxstore/cms/store.go | 2 +- business/model/act.go | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/business/jxstore/act/act.go b/business/jxstore/act/act.go index b8f8d7155..56ce09b51 100644 --- a/business/jxstore/act/act.go +++ b/business/jxstore/act/act.go @@ -117,7 +117,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac VendorID: vendorID, SyncStatus: model.SyncFlagNewMask, - VendorPrice: int64(jxutils.CaculateSkuVendorPrice(storeSkuInfo.Price, int(storeDetail.PricePercentage), 0)), + VendorPrice: int64(jxutils.CaculateSkuVendorPrice(storeSkuInfo.Price, jxutils.GetPricePercentage(storeDetail.PricePercentagePackObj, storeSkuInfo.Price, int(storeDetail.PricePercentage)), 0)), } v.OriginalPrice = actSkuMap.VendorPrice if v.ActPrice != 0 { @@ -499,7 +499,7 @@ func (a *ActManager) IsVendorActExist(ctx *jxcontext.Context, vendorActID string VendorActID: vendorActID, VendorID: vendorID, } - actMap.DeletedAt = utils.ZeroTimeValue + actMap.DeletedAt = utils.DefaultTimeValue if err := dao.GetEntity(db, actMap, "VendorActID", "VendorID", "DeletedAt"); err == nil { isExist = true } diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 0bb698339..95ba52f33 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -632,7 +632,7 @@ func SetStoreStatus(ctx *jxcontext.Context, storeID, status int) (err error) { func EnableHaveRestStores(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint string, err error) { storeInfo, err := GetStores(ctx, "", map[string]interface{}{ "statuss": string(utils.MustMarshal([]int{model.StoreStatusHaveRest})), - }, 0, model.UnlimitedPageSize, utils.ZeroTimeValue, utils.ZeroTimeValue, 0, 0) + }, 0, model.UnlimitedPageSize, utils.DefaultTimeValue, utils.DefaultTimeValue, 0, 0) if err != nil { return "", err } diff --git a/business/model/act.go b/business/model/act.go index 68320a66c..af6127377 100644 --- a/business/model/act.go +++ b/business/model/act.go @@ -89,7 +89,12 @@ type ActMap struct { func (*ActMap) TableUnique() [][]string { return [][]string{ []string{"ActID", "VendorID", "DeletedAt"}, - []string{"VendorActID", "VendorID", "DeletedAt"}, + } +} + +func (*ActMap) TableIndex() [][]string { + return [][]string{ + []string{"VendorActID", "VendorID", "DeletedAt"}, // 饿百,美团活动的VendorActID统一为空,不能设置为唯一索引 } }