This commit is contained in:
苏尹岚
2021-01-14 10:31:27 +08:00
parent af4b21ebb7
commit f3dd1b3e1e

View File

@@ -1150,9 +1150,14 @@ 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 {
user.LastStoreID = storeID
user.LastBrandID = brandID
_, err = dao.UpdateEntity(db, user, "LastStoreID", "LastBrandID")
if storeID != 0 {
user.LastStoreID = storeID
_, err = dao.UpdateEntity(db, user, "LastStoreID")
}
if brandID != 0 {
user.LastBrandID = brandID
_, err = dao.UpdateEntity(db, user, "LastBrandID")
}
}
return err
}