From a0d833d4ae39fc1f738726d1bf7a740cc606b007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 7 Jan 2020 11:03:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/event/event.go | 6 ++++-- business/model/dao/dao_order.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index 4a9713f86..429c57de3 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -1,9 +1,11 @@ package event -func AddOperateEvent() { +import "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" + +func AddOperateEvent(ctx *jxcontext.Context) { } -func AddOperateEventDetail() { +func AddOperateEventDetail(ctx *jxcontext.Context) { } diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 7339adfef..a0885ad7c 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -1096,6 +1096,7 @@ func GetOrdersSupplement(db *DaoDB, storIDs, vendorIDs, statuss []int, vendorOrd } else if IsReverse == 1 { sql += " AND link_id <> 0" } + sql += " ORDER BY supplement_time DESC" sql += " LIMIT ? OFFSET ?" sqlParams = append(sqlParams, pageSize, offset) Begin(db) From a47f7cd8454423880e75f170d11cdee282b2ab64 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 7 Jan 2020 18:30:22 +0800 Subject: [PATCH 2/7] CreateAct.OverlapRulep --- controllers/act.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/controllers/act.go b/controllers/act.go index 249714de6..d3626bfc2 100644 --- a/controllers/act.go +++ b/controllers/act.go @@ -76,6 +76,7 @@ func (c *ActController) PreCreateAct() { // @Param pricePercentage formData int true "活动价格比例" // @Param advertising formData string true "广告语" // @Param actStoreSkuList formData string true "活动门店商品信息" +// @Param overlapRule formData int false "活动重叠规则" // @Param limitDaily formData int false "是否按日0-不限,>0限购单数(秒杀需填)" // @Param limitUser formData int false "是否用户限购0-不限,1-限购" // @Param limitCount formData int false "限购件数 0-不限,如账号限购、设备限购有一个为1,则限购件数必须大于0的整数" @@ -94,11 +95,12 @@ func (c *ActController) CreateAct() { if err == nil { if err = jxutils.Strings2Objs(params.VendorIDs, &vendorIDs, params.ActStoreSkuList, &actStoreSkuList); err == nil { actObj := &model.Act{ - Name: params.Name, - Type: params.Type, - LimitUser: params.LimitUser, - LimitDaily: params.LimitDaily, - LimitCount: params.LimitCount, + Name: params.Name, + Type: params.Type, + LimitUser: params.LimitUser, + LimitDaily: params.LimitDaily, + LimitCount: params.LimitCount, + OverlapRule: params.OverlapRule, // Source:, CreateType: model.ActCreateTypeAPI, PricePercentage: params.PricePercentage, From aa84f7ae317f158002002c48fc8f90cac67d69d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 09:15:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=A0=B9=E6=8D=AEskuID=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 65bd5c91b..772e849a5 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2969,6 +2969,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuIDs []int, isAsync, isContin } } skuBindInfo := &StoreSkuBindInfo{ + StoreID: store.ID, NameID: k, UnitPrice: price, IsFocus: 1, @@ -2989,7 +2990,7 @@ func FocusStoreSkusBySku(ctx *jxcontext.Context, skuIDs []int, isAsync, isContin case 2: for _, v := range result1 { tUpdate := v.(*tUpdateStoresSkus) - UpdateStoresSkus(ctx, []int{tUpdate.StoreID}, tUpdate.SkuBindInfos, false, isAsync, isContinueWhenError) + UpdateStoresSkusByBind(ctx, tUpdate.SkuBindInfos, isAsync, isContinueWhenError) } } return result, err From f7d89c8fe3c37ffc4ddab31b27ad47354469df20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 09:25:08 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 772e849a5..23b422f2d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -262,7 +262,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool sql += ` JOIN store_sku_bind t4 ON t4.store_id = t3.id AND t4.sku_id = t2.id AND t4.deleted_at = ? LEFT JOIN sku_name_place_bind t5 ON t1.id = t5.name_id AND t3.city_code = t5.place_code - LEFT JOIN price_refer_snapshot t6 ON t6.city_code = 0 AND t6.sku_id = t2.id AND t6.snapshot_at = ? + LEFT JOIN price_refer_snapshot t6 ON t6.city_code = 0 AND t6.name_id = t1.id AND t6.snapshot_at = ? WHERE t1.deleted_at = ? AND (t1.is_global = 1 OR t5.id IS NOT NULL OR 1 = ?)/* AND t1.status = ?*/ ` sqlParams = append(sqlParams, []interface{}{ From 743238b9ec085570d6a6561928ac2cdfe862cf11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 09:28:45 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 23b422f2d..772e849a5 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -262,7 +262,7 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, isFocus bool sql += ` JOIN store_sku_bind t4 ON t4.store_id = t3.id AND t4.sku_id = t2.id AND t4.deleted_at = ? LEFT JOIN sku_name_place_bind t5 ON t1.id = t5.name_id AND t3.city_code = t5.place_code - LEFT JOIN price_refer_snapshot t6 ON t6.city_code = 0 AND t6.name_id = t1.id AND t6.snapshot_at = ? + LEFT JOIN price_refer_snapshot t6 ON t6.city_code = 0 AND t6.sku_id = t2.id AND t6.snapshot_at = ? WHERE t1.deleted_at = ? AND (t1.is_global = 1 OR t5.id IS NOT NULL OR 1 = ?)/* AND t1.status = ?*/ ` sqlParams = append(sqlParams, []interface{}{ From f5e8860b0ac185c0d9b2ab86a2f6ce9a303bf6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 09:46:05 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/report/report.go | 6 +++--- business/model/store.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/business/jxstore/report/report.go b/business/jxstore/report/report.go index e2b9b8f78..ca0b29060 100644 --- a/business/jxstore/report/report.go +++ b/business/jxstore/report/report.go @@ -65,6 +65,9 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn var priceReferSnapshotList []*model.PriceReferSnapshot db := dao.GetDB() snapshotAt := utils.Time2Date(time.Now().AddDate(0, 0, -1)) + dao.DeletePriceReferHistory(db, utils.Time2Date(snapshotAt.AddDate(0, 0, -7))) + priceReferSnapshotDelete := &model.PriceReferSnapshot{SnapshotAt: snapshotAt} + dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt") taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { switch step { case 0: @@ -79,9 +82,6 @@ func BeginSavePriceRefer(ctx *jxcontext.Context, cityCodes, skuIDs []int, isAsyn } } }() - dao.DeletePriceReferHistory(db, utils.Time2Date(snapshotAt.AddDate(0, 0, -7))) - priceReferSnapshotDelete := &model.PriceReferSnapshot{SnapshotAt: snapshotAt} - dao.DeleteEntity(db, priceReferSnapshotDelete, "SnapshotAt") taskFunc := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { v := batchItemList[0].(*model.PriceReferSnapshot) dao.WrapAddIDCULDEntity(v, ctx.GetUserName()) diff --git a/business/model/store.go b/business/model/store.go index 26ade2838..604371afc 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -475,7 +475,8 @@ type PriceReferSnapshot struct { func (*PriceReferSnapshot) TableUnique() [][]string { return [][]string{ - []string{"CityCode", "NameID", "SkuID", "SnapshotAt"}, + []string{"CityCode", "SkuID", "SnapshotAt"}, + []string{"CityCode", "NameID", "SnapshotAt"}, } } From 5fed851b8d79fb6cde1b4413910c088fc6f7781b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 09:47:09 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/business/model/store.go b/business/model/store.go index 604371afc..3ae1ba43f 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -476,7 +476,7 @@ type PriceReferSnapshot struct { func (*PriceReferSnapshot) TableUnique() [][]string { return [][]string{ []string{"CityCode", "SkuID", "SnapshotAt"}, - []string{"CityCode", "NameID", "SnapshotAt"}, + []string{"CityCode", "NameID", "SkuID", "SnapshotAt"}, } }