|
@@ -29,14 +29,14 @@ type SignupSpecialStatus struct {
|
|
|
SignupStatus int `description:"返回状态:1:成功 、2 :人数已满 、3:调研次数已用完、 4:超时"`
|
|
|
}
|
|
|
|
|
|
-//添加
|
|
|
+// 添加
|
|
|
func AddCygxActivitySpecialSignup(item *CygxActivitySpecialSignup) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
_, err = o.Insert(item)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取某一用户的报名的数量
|
|
|
+// 获取某一用户的报名的数量
|
|
|
func GetUserCygxActivitySpecialSignup(uid, activityId int) (count int, err error) {
|
|
|
sqlCount := `SELECT COUNT(1) AS count FROM cygx_activity_special_signup WHERE user_id=? AND activity_id =? `
|
|
|
o := orm.NewOrm()
|
|
@@ -44,7 +44,7 @@ func GetUserCygxActivitySpecialSignup(uid, activityId int) (count int, err error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//删除
|
|
|
+// 删除
|
|
|
func DeleteCygxActivitySpecialSignup(uid, activityId int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `DELETE FROM cygx_activity_special_signup WHERE user_id=? AND activity_id=? `
|
|
@@ -52,7 +52,7 @@ func DeleteCygxActivitySpecialSignup(uid, activityId int) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//列表
|
|
|
+// 列表
|
|
|
func GetActivityListSpecialAll(activityId int) (items []*CygxActivitySpecialSignup, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT art.* FROM cygx_activity_special_signup as art WHERE 1= 1 AND activity_id = ? GROUP BY company_id`
|
|
@@ -60,7 +60,7 @@ func GetActivityListSpecialAll(activityId int) (items []*CygxActivitySpecialSign
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//列表
|
|
|
+// 列表
|
|
|
func GetActivityListSpecialByActivityId(activityId int) (items []*CygxActivitySpecialSignup, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT art.* FROM cygx_activity_special_signup as art WHERE 1= 1 AND activity_id = ? `
|
|
@@ -82,20 +82,20 @@ type CygxActivitySpecialSignupResp struct {
|
|
|
Count string `description:"所属销售"`
|
|
|
}
|
|
|
|
|
|
-//列表
|
|
|
+// 列表
|
|
|
func GetActivityListSpecialGroupByMobile(condition string, pars []interface{}) (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
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`
|
|
|
+ ` + condition + ` GROUP BY s.mobile`
|
|
|
_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//列表
|
|
|
+// 列表
|
|
|
func GetActivityListSpecialGroupByCompanyId(condition string, pars []interface{}) (items []*CygxActivitySpecialSignupResp, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
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`
|
|
|
+ ` + condition + ` GROUP BY s.company_id`
|
|
|
_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
return
|
|
|
}
|