|
@@ -73,18 +73,20 @@ type CygxActivitySpecialSignupResp struct {
|
|
|
}
|
|
|
|
|
|
//列表
|
|
|
-func GetActivityListSpecialGroupByMobile() (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
+func GetActivityListSpecialGroupByMobile(condition string, pars []interface{}) (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT *, COUNT( 1 ) AS count FROM cygx_activity_special_signup GROUP BY mobile`
|
|
|
- _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ sql := `SELECT s.*, COUNT( 1 ) AS count FROM cygx_activity_special_signup as s INNER JOIN cygx_activity_special AS a ON a.activity_id = s.activity_id
|
|
|
+ INNER JOIN wx_user AS u ON u.user_id = s.user_id ` + condition + ` GROUP BY s.mobile`
|
|
|
+ _, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//列表
|
|
|
-func GetActivityListSpecialGroupByCompanyId() (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
+func GetActivityListSpecialGroupByCompanyId(condition string, pars []interface{}) (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT *, COUNT( 1 ) AS count FROM cygx_activity_special_signup GROUP BY company_id`
|
|
|
- _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ sql := `SELECT *, COUNT( 1 ) AS count FROM cygx_activity_special_signup as s INNER JOIN cygx_activity_special AS a ON a.activity_id = s.activity_id
|
|
|
+ INNER JOIN wx_user AS u ON u.user_id = s.user_id ` + condition + ` GROUP BY s.company_id`
|
|
|
+ _, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|