|
|
|
@ -20,20 +20,20 @@ import (
|
|
|
|
|
type AppUserReq struct {
|
|
|
|
|
bean.Page
|
|
|
|
|
AppUserInfo
|
|
|
|
|
Start string `json:"start"`
|
|
|
|
|
End string `json:"end"`
|
|
|
|
|
Kind uint `json:"kind"`
|
|
|
|
|
TaxBillType string `json:"taxBillType"`
|
|
|
|
|
Start string `json:"start"`
|
|
|
|
|
End string `json:"end"`
|
|
|
|
|
Kind uint `json:"kind"`
|
|
|
|
|
TaxBillType string `json:"taxBillType"`
|
|
|
|
|
IsEnterprise uint `json:"isEnterprise"` // 1公司 2 个人
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AppUserInfo struct {
|
|
|
|
|
Mobile string `json:"mobile"`
|
|
|
|
|
Nickname string `json:"nickname"`
|
|
|
|
|
Level uint `json:"level"`
|
|
|
|
|
IsOffline bool `json:"is_offline"`
|
|
|
|
|
CreatedAt formatime.Second `json:"created_at"`
|
|
|
|
|
TaxType string `json:"tax_type"`
|
|
|
|
|
IsEnterprise uint `json:"isEnterprise"` // 1 公司 0 个人
|
|
|
|
|
Mobile string `json:"mobile"`
|
|
|
|
|
Nickname string `json:"nickname"`
|
|
|
|
|
Level uint `json:"level"`
|
|
|
|
|
IsOffline bool `json:"is_offline"`
|
|
|
|
|
CreatedAt formatime.Second `json:"created_at"`
|
|
|
|
|
TaxType string `json:"tax_type"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (o logic) AppUser(args AppUserReq) (res []AppUserInfo, total int64, err error) {
|
|
|
|
@ -68,8 +68,12 @@ func (o logic) AppUser(args AppUserReq) (res []AppUserInfo, total int64, err err
|
|
|
|
|
if args.TaxType != "" {
|
|
|
|
|
query = query.Where("id in (?)", mysql.Db.Select("user_id").Model(&company.Info{}).Where("tax_type = ?", args.TaxType))
|
|
|
|
|
}
|
|
|
|
|
if args.IsEnterprise == 0 || args.IsEnterprise == 1 {
|
|
|
|
|
query = query.Where("is_enterprise = ? ", args.IsEnterprise)
|
|
|
|
|
if args.IsEnterprise != 0 { // 判断公司还是个人
|
|
|
|
|
if args.IsEnterprise == 1 {
|
|
|
|
|
query = query.Where("is_enterprise = ? ", args.IsEnterprise)
|
|
|
|
|
} else {
|
|
|
|
|
query = query.Where("is_enterprise = ? ", 0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
query.Count(&total)
|
|
|
|
|