This commit is contained in:
rosydev
2022-03-03 17:46:38 +08:00
parent eac5c5a0d1
commit 6c5416f89b

View File

@@ -1223,24 +1223,17 @@ func UpdateUserLastInfo(ctx *jxcontext.Context, storeID, brandID int) (err error
db = dao.GetDB() db = dao.GetDB()
) )
if user, err := dao.GetUserByID(db, "user_id", ctx.GetUserID()); err == nil { 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 user.LastStoreID = storeID
if user.LastBrandID > 1 { _, err = dao.UpdateEntity(db, user, "LastStoreID")
user.LastBrandID = 0
}
} else { //带参数进入的店铺
user.LastStoreID = storeID
if storeID == model.MatterStoreID { //物料店比较特殊
user.LastBrandID = 1
} else {
user.LastBrandID = storeID
} }
} if brandID != user.LastBrandID {
_, err = dao.UpdateEntity(db, user, "LastStoreID") user.LastBrandID = brandID
_, err = dao.UpdateEntity(db, user, "LastBrandID") _, err = dao.UpdateEntity(db, user, "LastBrandID")
} }
}
return err return err
} }