This commit is contained in:
苏尹岚
2020-11-10 10:38:25 +08:00
parent 32cecd0e98
commit 1aaeab99cc
3 changed files with 26 additions and 5 deletions

View File

@@ -284,6 +284,10 @@ func GetUsers(ctx *jxcontext.Context, userType int, keyword string, userIDs []st
return pagedInfo, err
}
func GetUser(ctx *jxcontext.Context, userID string) (user *model.User, err error) {
return user, err
}
func checkUserType(userID string, userType int8) (err error) {
userList, _, err := dao.GetUsers(dao.GetDB(), 0, "", []string{userID}, nil, nil, 0, 0)
if err != nil {

View File

@@ -67,7 +67,7 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
sqlParams := []interface{}{}
sql := `
SELECT SQL_CALC_FOUND_ROWS
t1.*, t2.accept_order_count, t3.finished_order_count
t1.*, IF(t2.accept_order_count is NULL, 0, t2.accept_order_count), IF(t3.finished_order_count is NULL, 0, t3.finished_order_count)
FROM user t1
LEFT JOIN (SELECT user_id, COUNT(user_id) accept_order_count FROM job_order`
if len(userIDs) > 0 {
@@ -110,6 +110,9 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
return userList, totalCount, err
}
type GetUserResult struct {
}
func DeleteUsers(db *DaoDB, userIDs []string) (num int64, err error) {
if len(userIDs) > 0 {
sql := `

View File

@@ -64,10 +64,10 @@ func (c *User2Controller) GetBindAuthInfo() {
// @Description 得到用户列表
// @Param token header string true "认证token"
// @Param userType query int true "用户类型0表示全部"
// @Param keyword query string faslse "关键字,可以部分匹配"
// @Param userIDs query string faslse "用户id列表"
// @Param userID2 query string faslse "用户id2必须全匹配外部唯一标识"
// @Param mobile query string faslse "用户手机,必须全匹配"
// @Param keyword query string false "关键字,可以部分匹配"
// @Param userIDs query string false "用户id列表"
// @Param userID2 query string false "用户id2必须全匹配外部唯一标识"
// @Param mobile query string false "用户手机,必须全匹配"
// @Param offset query int false "门店列表起始序号以0开始缺省为0"
// @Param pageSize query int false "门店列表页大小缺省为50-1表示全部"
// @Success 200 {object} controllers.CallResult
@@ -83,6 +83,20 @@ func (c *User2Controller) GetUsers() {
})
}
// @Title 得到用户
// @Description 得到用户
// @Param token header string true "认证token"
// @Param userID query string true "用户id"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetUser [get]
func (c *User2Controller) GetUser() {
c.callGetUser(func(params *tUser2GetUserParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetUser(params.Ctx, params.UserID)
return retVal, "", err
})
}
// @Title 用户自己增加配送地址
// @Description 用户自己增加配送地址
// @Param token header string true "认证token"