From f3dd1b3e1e23232c81076f2548a0d8878a0f7cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 14 Jan 2021 10:31:27 +0800 Subject: [PATCH] aa --- business/jxstore/cms/user2.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index 93ceb59f3..1d99078e4 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -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 }