getusers
This commit is contained in:
@@ -284,6 +284,10 @@ func GetUsers(ctx *jxcontext.Context, userType int, keyword string, userIDs []st
|
|||||||
return pagedInfo, err
|
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) {
|
func checkUserType(userID string, userType int8) (err error) {
|
||||||
userList, _, err := dao.GetUsers(dao.GetDB(), 0, "", []string{userID}, nil, nil, 0, 0)
|
userList, _, err := dao.GetUsers(dao.GetDB(), 0, "", []string{userID}, nil, nil, 0, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
|
|||||||
sqlParams := []interface{}{}
|
sqlParams := []interface{}{}
|
||||||
sql := `
|
sql := `
|
||||||
SELECT SQL_CALC_FOUND_ROWS
|
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
|
FROM user t1
|
||||||
LEFT JOIN (SELECT user_id, COUNT(user_id) accept_order_count FROM job_order`
|
LEFT JOIN (SELECT user_id, COUNT(user_id) accept_order_count FROM job_order`
|
||||||
if len(userIDs) > 0 {
|
if len(userIDs) > 0 {
|
||||||
@@ -110,6 +110,9 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
|
|||||||
return userList, totalCount, err
|
return userList, totalCount, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetUserResult struct {
|
||||||
|
}
|
||||||
|
|
||||||
func DeleteUsers(db *DaoDB, userIDs []string) (num int64, err error) {
|
func DeleteUsers(db *DaoDB, userIDs []string) (num int64, err error) {
|
||||||
if len(userIDs) > 0 {
|
if len(userIDs) > 0 {
|
||||||
sql := `
|
sql := `
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ func (c *User2Controller) GetBindAuthInfo() {
|
|||||||
// @Description 得到用户列表
|
// @Description 得到用户列表
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param userType query int true "用户类型(0表示全部)"
|
// @Param userType query int true "用户类型(0表示全部)"
|
||||||
// @Param keyword query string faslse "关键字,可以部分匹配"
|
// @Param keyword query string false "关键字,可以部分匹配"
|
||||||
// @Param userIDs query string faslse "用户id列表"
|
// @Param userIDs query string false "用户id列表"
|
||||||
// @Param userID2 query string faslse "用户id2,必须全匹配(外部唯一标识)"
|
// @Param userID2 query string false "用户id2,必须全匹配(外部唯一标识)"
|
||||||
// @Param mobile query string faslse "用户手机,必须全匹配"
|
// @Param mobile query string false "用户手机,必须全匹配"
|
||||||
// @Param offset query int false "门店列表起始序号(以0开始,缺省为0)"
|
// @Param offset query int false "门店列表起始序号(以0开始,缺省为0)"
|
||||||
// @Param pageSize query int false "门店列表页大小(缺省为50,-1表示全部)"
|
// @Param pageSize query int false "门店列表页大小(缺省为50,-1表示全部)"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @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 用户自己增加配送地址
|
// @Title 用户自己增加配送地址
|
||||||
// @Description 用户自己增加配送地址
|
// @Description 用户自己增加配送地址
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
|
|||||||
Reference in New Issue
Block a user