|
@@ -65,7 +65,7 @@ type CompanyUserListResp struct {
|
|
|
}
|
|
|
|
|
|
// 获取数量
|
|
|
-func GetCompanyListCount(userCondition, keyWord, kwywordcondition, condition, roleTypeCode string, pars []interface{}) (count int, err error) {
|
|
|
+func GetCompanyListCount(joinTable, userCondition, keyWord, kwywordcondition, condition, roleTypeCode string, pars []interface{}) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
companyCondition := `SELECT a.company_id FROM company AS a INNER JOIN company_product AS b ON a.company_id=b.company_id WHERE a.enabled=1 `
|
|
|
kwywordcondition = companyCondition + kwywordcondition
|
|
@@ -79,7 +79,7 @@ func GetCompanyListCount(userCondition, keyWord, kwywordcondition, condition, ro
|
|
|
INNER JOIN company AS c ON c.company_id = u.company_id
|
|
|
INNER JOIN company_product AS cp ON cp.company_id = c.company_id
|
|
|
INNER JOIN admin AS m ON m.admin_id = cp.seller_id
|
|
|
- INNER JOIN user_seller_relation AS sr ON sr.user_id = u.user_id
|
|
|
+ INNER JOIN user_seller_relation AS sr ON sr.user_id = u.user_id ` + joinTable + `
|
|
|
WHERE u.company_id IN (` + companyCondition + `)`
|
|
|
if userCondition != "" {
|
|
|
sql += userCondition
|
|
@@ -97,14 +97,14 @@ func GetCompanyListCount(userCondition, keyWord, kwywordcondition, condition, ro
|
|
|
}
|
|
|
|
|
|
// 列表
|
|
|
-func GetCygxCompanyUserList(userCondition, keyWord, kwywordcondition, condition, roleTypeCode, sqlOrder string, pars []interface{}, startSize, pageSize int) (items []*CygxCompanyUser, err error) {
|
|
|
+func GetCygxCompanyUserList(joinTable, tableField, userCondition, keyWord, kwywordcondition, condition, roleTypeCode, sqlOrder string, pars []interface{}, startSize, pageSize int) (items []*CygxCompanyUser, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
companyCondition := `SELECT a.company_id FROM company AS a INNER JOIN company_product AS b ON a.company_id=b.company_id WHERE a.enabled=1 `
|
|
|
kwywordcondition = companyCondition + kwywordcondition
|
|
|
if condition != "" {
|
|
|
companyCondition += condition
|
|
|
}
|
|
|
- sql := `SELECT
|
|
|
+ sql := `SELECT` + tableField + `
|
|
|
u.user_id,
|
|
|
u.mobile,
|
|
|
u.email,
|
|
@@ -130,7 +130,7 @@ func GetCygxCompanyUserList(userCondition, keyWord, kwywordcondition, condition,
|
|
|
INNER JOIN company AS c ON c.company_id = u.company_id
|
|
|
INNER JOIN company_product AS cp ON cp.company_id = c.company_id
|
|
|
INNER JOIN admin AS m ON m.admin_id = cp.seller_id
|
|
|
- INNER JOIN user_seller_relation AS sr ON sr.user_id = u.user_id
|
|
|
+ INNER JOIN user_seller_relation AS sr ON sr.user_id = u.user_id ` + joinTable + `
|
|
|
WHERE u.company_id IN (` + companyCondition + `)`
|
|
|
if userCondition != "" {
|
|
|
sql += userCondition
|