---bug
This commit is contained in:
@@ -1223,23 +1223,16 @@ 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 { //带参数进入的店铺
|
if brandID != user.LastBrandID {
|
||||||
user.LastStoreID = storeID
|
user.LastBrandID = brandID
|
||||||
if storeID == model.MatterStoreID { //物料店比较特殊
|
_, err = dao.UpdateEntity(db, user, "LastBrandID")
|
||||||
user.LastBrandID = 1
|
|
||||||
} else {
|
|
||||||
user.LastBrandID = storeID
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
_, err = dao.UpdateEntity(db, user, "LastStoreID")
|
|
||||||
_, err = dao.UpdateEntity(db, user, "LastBrandID")
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user