From 1bba3f71c349af7e19787b23388381b5a1cacae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 26 Mar 2020 10:32:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E9=93=B6=E8=B1=B9=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=A2=9E=E5=8A=A0=E9=97=A8=E5=BA=97=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store.go | 7 +++++++ business/model/store.go | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index c2ce3b835..e00a4d962 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -2882,6 +2882,7 @@ func checkYbParams(db *dao.DaoDB, storeMap *model.StoreMap, storeID int) (err er appID = storeMap.YbAppID appKey = storeMap.YbAppKey yinbaoCookie string + storeMap2 *model.StoreMap ) if appID == "" { return fmt.Errorf("绑定银豹平台必须输入appID!") @@ -2929,5 +2930,11 @@ func checkYbParams(db *dao.DaoDB, storeMap *model.StoreMap, storeID int) (err er } } } + sql := "SELECT * FROM store_map WHERE vendor_id = ? and deleted_at = ? ORDER BY yb_store_prefix DESC LIMIT 1" + sqlParams := []interface{}{model.VendorIDYB, utils.DefaultTimeValue} + err = dao.GetRow(db, &storeMap2, sql, sqlParams) + if err == nil { + storeMap.YbStorePrefix = utils.Int64ToStr(utils.Str2Int64(storeMap2.YbStorePrefix) + 1) + } return err } diff --git a/business/model/store.go b/business/model/store.go index 9f68a71c3..0655c2ea9 100644 --- a/business/model/store.go +++ b/business/model/store.go @@ -423,8 +423,9 @@ type StoreMap struct { IsOrder int `orm:"default(0)" json:"isOrder"` //是否是下预订单门店 - YbAppID string `orm:"column(yb_app_id);size(255)" json:"ybAppID"` - YbAppKey string `orm:"size(255)" json:"ybAppKey"` + YbAppID string `orm:"column(yb_app_id);size(255)" json:"ybAppID"` + YbAppKey string `orm:"size(255)" json:"ybAppKey"` + YbStorePrefix string `orm:"size(255)" json:"ybStorePrefix"` } func (*StoreMap) TableUnique() [][]string {