Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -86,15 +86,11 @@ func (s *sMerchantAdmin) Login(ctx context.Context, in *model.MerchantLoginIn) (
|
||||
LastLoginAt: gtime.Now(),
|
||||
LastLoginIp: ghttp.RequestFromCtx(ctx).RemoteAddr,
|
||||
})
|
||||
}(ctx, mAdminId)
|
||||
}(context.Background(), mAdminId)
|
||||
return
|
||||
}
|
||||
func (s *sMerchantAdmin) Info(ctx context.Context, in *model.MerchantAdminInfoIn) (out *model.MerchantAdminInfoOut, err error) {
|
||||
one, err := dao.MerchantAdmins.Ctx(ctx).WherePri(in.MerchantAdminId).
|
||||
LeftJoin(
|
||||
dao.Stores.Table(),
|
||||
fmt.Sprintf("%s.%s = %s.%s", dao.Stores.Table(), dao.Stores.Columns().MerchantId, dao.MerchantAdmins.Table(), dao.MerchantAdmins.Columns().MerchantId)).
|
||||
Fields(fmt.Sprintf("%s.*, %s.%s %s", dao.MerchantAdmins.Table(), dao.Stores.Table(), dao.Stores.Columns().Id, "storeId")).One()
|
||||
one, err := dao.MerchantAdmins.Ctx(ctx).WherePri(in.MerchantAdminId).One()
|
||||
if err != nil {
|
||||
return nil, ecode.Fail.Sub("查询商户管理员失败")
|
||||
}
|
||||
@ -108,7 +104,6 @@ func (s *sMerchantAdmin) Info(ctx context.Context, in *model.MerchantAdminInfoIn
|
||||
return &model.MerchantAdminInfoOut{
|
||||
Username: admin.Username,
|
||||
MerchantId: admin.MerchantId,
|
||||
StoreId: one["storeId"].Int64(),
|
||||
}, nil
|
||||
}
|
||||
func (s *sMerchantAdmin) Code(ctx context.Context, in *model.MerchantAdminCodeIn) (out *model.MerchantAdminCodeOut, err error) {
|
||||
|
||||
@ -23,7 +23,15 @@ func init() {
|
||||
}
|
||||
func (s *sStore) List(ctx context.Context, in *model.StoreListIn) (out *model.StoreListOut, err error) {
|
||||
// 1. 初始化返回数据
|
||||
return
|
||||
list := make([]model.Store, 0)
|
||||
var total int
|
||||
if err = dao.Stores.Ctx(ctx).Page(in.Page, in.Size).ScanAndCount(&list, &total, false); err != nil {
|
||||
return nil, ecode.Fail.Sub("门店列表获取失败")
|
||||
}
|
||||
return &model.StoreListOut{
|
||||
List: list,
|
||||
Total: total,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *sStore) Create(ctx context.Context, in *model.StoreCreateIn) (out *model.CreateOut, err error) {
|
||||
|
||||
Reference in New Issue
Block a user