|
@@ -210,3 +210,22 @@ func AddCountryCode(CountryCode string, userId int) (err error) {
|
|
|
_, err = o.Raw(sql, CountryCode, userId).Exec()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func GetUser(startSize, pageSize, userId int) (items []*ArticleInterviewApplyList, err error) {
|
|
|
+ sql := `SELECT u.real_name ,u.mobile,u.country_code,c.company_name,cp.seller_name,
|
|
|
+ GROUP_CONCAT( DISTINCT b.chart_permission_name SEPARATOR '/' ) AS permission
|
|
|
+ FROM wx_user AS u
|
|
|
+ INNER JOIN company as c ON c.company_id = u.company_id
|
|
|
+ INNER JOIN company_report_permission AS p ON p.company_id = u.company_id
|
|
|
+ INNER JOIN chart_permission AS b ON b.chart_permission_id=p.chart_permission_id
|
|
|
+ INNER JOIN company_product AS cp ON cp.company_id = u.company_id
|
|
|
+ WHERE p.status IN('正式','试用')
|
|
|
+ AND p.product_id = 2
|
|
|
+ AND cp.product_id = 2
|
|
|
+ AND u.company_id >1
|
|
|
+ AND u.mobile = u.outbound_mobile
|
|
|
+ AND u.mobile != ''
|
|
|
+ GROUP BY u.user_id`
|
|
|
+ _, err = orm.NewOrm().Raw(sql, userId, startSize, pageSize).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|