-----bug of goto shop

This commit is contained in:
rosydev
2022-03-03 16:52:06 +08:00
parent 908f4debc7
commit 6ead25a7af

View File

@@ -1223,21 +1223,23 @@ 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 {
if storeID != 0 {
//不带参数进入的店铺品牌值为0
if storeID == 0 || storeID == 102919 {
user.LastStoreID = storeID
_, err = dao.UpdateEntity(db, user, "LastStoreID")
}
//扫码进店,会绑定这个店铺。通过公众号进入模板店后,初始化为最初状态。
// 上次看到的是模板店,初始化为未进过任何店.Shi
if brandID != 0 {
if storeID == 102919 {
if user.LastBrandID > 1 {
user.LastBrandID = 0
} else {
user.LastBrandID = brandID
}
_, err = dao.UpdateEntity(db, user, "LastBrandID")
} else { //带参数进入的店铺
user.LastStoreID = storeID
if storeID == model.MatterStoreID { //物料店比较特殊
user.LastBrandID = 1
} else {
user.LastBrandID = storeID
}
}
_, err = dao.UpdateEntity(db, user, "LastStoreID")
_, err = dao.UpdateEntity(db, user, "LastBrandID")
}
return err
}