From 6c5416f89b69df6c6aa45db059e604134a5a217d Mon Sep 17 00:00:00 2001 From: rosydev Date: Thu, 3 Mar 2022 17:46:38 +0800 Subject: [PATCH] ---bug --- business/jxstore/cms/user2.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index a1dc6d70a..8d676756a 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -1223,23 +1223,16 @@ func UpdateUserLastInfo(ctx *jxcontext.Context, storeID, brandID int) (err error db = dao.GetDB() ) if user, err := dao.GetUserByID(db, "user_id", ctx.GetUserID()); err == nil { - //不带参数进入的店铺,品牌值为0 - if storeID == 0 || storeID == 102919 { + //本次与上次不同时再更新 + if storeID != user.LastStoreID { user.LastStoreID = storeID - if user.LastBrandID > 1 { - user.LastBrandID = 0 - } - } else { //带参数进入的店铺 - user.LastStoreID = storeID - if storeID == model.MatterStoreID { //物料店比较特殊 - user.LastBrandID = 1 - } else { - user.LastBrandID = storeID - } - + _, err = dao.UpdateEntity(db, user, "LastStoreID") + } + + if brandID != user.LastBrandID { + user.LastBrandID = brandID + _, err = dao.UpdateEntity(db, user, "LastBrandID") } - _, err = dao.UpdateEntity(db, user, "LastStoreID") - _, err = dao.UpdateEntity(db, user, "LastBrandID") } return err }