|
@@ -88,13 +88,6 @@ type ActivityCheck struct {
|
|
|
ActivityPoints string `description:"本场活动要扣除的点数"`
|
|
|
}
|
|
|
|
|
|
-type Activity struct {
|
|
|
- ActivityTypeId int `description:"活动类型id"`
|
|
|
- ActivityTypeName string `description:"活动名称"`
|
|
|
- TemplateP string `description:"活动模板,带P标签"`
|
|
|
- Template string `description:"活动模板"`
|
|
|
- ShowType string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
|
|
|
-}
|
|
|
type ActivityIdRep struct {
|
|
|
ActivityId int `description:"活动id"`
|
|
|
PlaySeconds int `description:"播放时长"`
|
|
@@ -275,14 +268,6 @@ func GetAddActivityInfoByActivityId(ActivityId int) (item *ActivityDetail, err e
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// 通过活动名称获取活动详情
|
|
|
-func GetAddActivityInfoByTitle(title, startDate, endDate string) (item *ActivityDetail, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT * FROM cygx_activity WHERE activity_time > '` + startDate + `' AND activity_time < '` + endDate + `' AND (activity_name_task LIKE '%` + title + `%' OR jmcj_roadshow_title LIKE '%` + title + `%') AND activity_id NOT IN (1328) LIMIT 1 `
|
|
|
- err = o.Raw(sql).QueryRow(&item)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
// 通过纪要ID获取活动详情
|
|
|
func GetAddActivityInfoByIdShow(uid, ActivityId int) (item *ActivityDetail, err error) {
|
|
|
o := orm.NewOrm()
|
|
@@ -342,40 +327,6 @@ type GetCygxActivityListRep struct {
|
|
|
IsShowResearchPoints bool `description:"是否展示研选扣点搜索"`
|
|
|
}
|
|
|
|
|
|
-// 获取我的日程数量
|
|
|
-func GetSpecialScheduleCount(uid int) (count int, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sqlCount := `
|
|
|
-SELECT COUNT( 1 ) AS count FROM
|
|
|
- cygx_activity_special AS art
|
|
|
- INNER JOIN cygx_activity_special_trip AS my ON my.activity_id = art.activity_id
|
|
|
- WHERE
|
|
|
- 1 = 1 AND my.user_id = ? AND my.is_cancel = 0`
|
|
|
- err = o.Raw(sqlCount, uid).QueryRow(&count)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// 获取数量
|
|
|
-func GetActivityCount(condition string, playBack int, pars []interface{}, filter int) (count int, err error) {
|
|
|
- var sqlJiontable string
|
|
|
- if playBack == 1 {
|
|
|
- //sqlJiontable = ` INNER JOIN cygx_activity_voice AS ac ON ac.activity_id = art.activity_id `
|
|
|
- }
|
|
|
-
|
|
|
- if filter == 1 {
|
|
|
- sqlJiontable = ` INNER JOIN cygx_activity_video AS av ON av.activity_id = art.activity_id `
|
|
|
- } else if filter == 2 {
|
|
|
- sqlJiontable = ` INNER JOIN cygx_activity_voice AS ac ON ac.activity_id = art.activity_id `
|
|
|
- }
|
|
|
- sqlCount := ` SELECT COUNT(1) AS count FROM cygx_activity as art ` + sqlJiontable + ` WHERE 1= 1 `
|
|
|
- if condition != "" {
|
|
|
- sqlCount += condition
|
|
|
- }
|
|
|
- o := orm.NewOrm()
|
|
|
- err = o.Raw(sqlCount, pars).QueryRow(&count)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
// 获取我的日程数量
|
|
|
func GetScheduleCount(condition string, uid int) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
@@ -473,32 +424,6 @@ type ActivityMsgExportRep struct {
|
|
|
CreateTime string `description:"提交时间"`
|
|
|
}
|
|
|
|
|
|
-func GetSignupExport(activityId int) (item []*SignupExportRep, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT
|
|
|
- s.outbound_mobile,
|
|
|
- s.country_code,
|
|
|
- a.is_limit_people,
|
|
|
- s.real_name,
|
|
|
- s.seller_name,
|
|
|
- s.company_id,
|
|
|
- s.company_name
|
|
|
- FROM
|
|
|
- cygx_activity_signup AS s
|
|
|
- JOIN cygx_activity AS a ON a.activity_id = s.activity_id
|
|
|
- WHERE a.activity_id = ? AND s.do_fail_type = 0 AND s.signup_type = 1 GROUP BY s.id `
|
|
|
- _, err = o.Raw(sql, activityId).QueryRows(&item)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// 修改文件是否推送状态
|
|
|
-func UPdateActivityIdToSendFile(activityId int) (err error) {
|
|
|
- sql := ` UPDATE cygx_activity SET is_send_file_toemail= 1 WHERE activity_id = ?`
|
|
|
- o := orm.NewOrm()
|
|
|
- _, err = o.Raw(sql, activityId).Exec()
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
// 活动详情
|
|
|
type CygxActivityLabelList struct {
|
|
|
KeyWord string `orm:"column(label)";description:"主题"`
|
|
@@ -521,108 +446,12 @@ type CygxActivityLabelList struct {
|
|
|
ChartPermissionId int `description:"行业id"`
|
|
|
}
|
|
|
|
|
|
-// 主题列表
|
|
|
-func GetActivityLabelListAll(condition, sortTime string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityLabelList, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT activity_id,activity_type_id, label,temporary_label,is_show_subject_name, MAX( art.activity_time ) AS timesort, MIn( art.activity_time ) AS mintimesort , yidong_activity_id,city,is_external_label,is_research_points,chart_permission_id
|
|
|
- FROM cygx_activity as art WHERE 1= 1 `
|
|
|
- if condition != "" {
|
|
|
- sql += condition
|
|
|
- }
|
|
|
- sql += ` GROUP BY art.activity_id ORDER BY ` + sortTime + ` ,art.activity_id DESC LIMIT ?,? `
|
|
|
-
|
|
|
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// 主题列表
|
|
|
-func GetActivityLabelListCity() (items []*CygxActivity, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT
|
|
|
- activity_id,
|
|
|
- activity_type_id,
|
|
|
- activity_time,
|
|
|
- label,
|
|
|
- temporary_label,
|
|
|
- is_show_subject_name,
|
|
|
- yidong_activity_id,
|
|
|
- city
|
|
|
- FROM
|
|
|
- cygx_activity AS art
|
|
|
- WHERE
|
|
|
- 1 = 1
|
|
|
- AND art.active_state IN ( 1, 2 )
|
|
|
- AND city != ''
|
|
|
- ORDER BY
|
|
|
- activity_time ASC `
|
|
|
- _, err = o.Raw(sql).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
type GetCygxActivityLabelListRep struct {
|
|
|
Label string `description:"主题"`
|
|
|
ImgUrl string `description:"图片路径"`
|
|
|
List []*CygxActivityLabelList
|
|
|
}
|
|
|
|
|
|
-// 获取研选系列专家电话会,会前1小时,满足推送的活动ID数量
|
|
|
-func GetCountActivityResearchToSendFile(condition, endDate string) (count int, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT
|
|
|
- COUNT(1) count
|
|
|
-FROM
|
|
|
- cygx_activity AS a
|
|
|
- INNER JOIN cygx_activity_help_ask AS k ON k.activity_id = a.activity_id
|
|
|
-WHERE
|
|
|
- 1 = 1 ` + condition + `
|
|
|
- AND a.is_send_ask_msg = 0
|
|
|
- AND a.activity_time <= ?
|
|
|
- AND a.activity_time >= NOW()`
|
|
|
- err = o.Raw(sql, endDate).QueryRow(&count)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// 获取研选系列专家电话会,会前1小时,满足推送的活动ID
|
|
|
-func GetActivityResearchToSendFile(condition, endDate string) (items []*ActivityIdRep, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT
|
|
|
- *
|
|
|
-FROM
|
|
|
- cygx_activity AS a
|
|
|
- INNER JOIN cygx_activity_help_ask AS k ON k.activity_id = a.activity_id
|
|
|
-WHERE
|
|
|
- 1 = 1 ` + condition + `
|
|
|
- AND a.is_send_ask_msg = 0
|
|
|
- AND a.activity_time <= ?
|
|
|
- AND a.activity_time >= NOW()
|
|
|
-GROUP BY
|
|
|
- a.activity_id `
|
|
|
- _, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-func GetActivityMsgExport(activityId int) (item []*ActivityMsgExportRep, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT
|
|
|
- k.*
|
|
|
- FROM
|
|
|
- cygx_activity_help_ask AS k
|
|
|
- WHERE
|
|
|
- k.activity_id = ?
|
|
|
- GROUP BY
|
|
|
- k.ask_id`
|
|
|
- _, err = o.Raw(sql, activityId).QueryRows(&item)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-// 修改文件带问消息是否推送状态
|
|
|
-func UPdateActivityMsgToSendFile(activityId int) (err error) {
|
|
|
- sql := ` UPDATE cygx_activity SET is_send_ask_msg= 1 WHERE activity_id = ?`
|
|
|
- o := orm.NewOrm()
|
|
|
- _, err = o.Raw(sql, activityId).Exec()
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
type AskEmailRep struct {
|
|
|
Name string `description:"姓名"`
|
|
|
Email string `description:"邮箱"`
|
|
@@ -636,19 +465,6 @@ func GetAskEmail() (item []*AskEmailRep, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// 主题列表
|
|
|
-func GetActivityLabelSpecialListAll(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxActivityLabelList, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT label,activity_id,is_show_subject_name,days
|
|
|
- FROM cygx_activity_special as art WHERE 1= 1 `
|
|
|
- if condition != "" {
|
|
|
- sql += condition
|
|
|
- }
|
|
|
- sql += ` LIMIT ?,? `
|
|
|
- _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
type GetCygxActivitySpecialDetailListResp struct {
|
|
|
IsFollow bool `description:"是否关注新调研通知"`
|
|
|
IsBindingMobile bool `description:"是否绑定了手机号"`
|
|
@@ -773,20 +589,6 @@ func GetActivityListNew(condition string, pars []interface{}, uid, startSize, pa
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// 列表
|
|
|
-func GetActivityListHomeNew(condition string, startSize, pageSize int) (items []*ActivityDetail, err error) {
|
|
|
- o := orm.NewOrm()
|
|
|
- sql := `SELECT activity_id
|
|
|
- FROM cygx_activity as art
|
|
|
- INNER JOIN cygx_activity_type as t ON t.activity_type_id = art.activity_type_id WHERE 1= 1 `
|
|
|
- if condition != "" {
|
|
|
- sql += condition
|
|
|
- }
|
|
|
- sql += ` LIMIT ?,?`
|
|
|
- _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
// 列表
|
|
|
func GetCygxActivityList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxActivity, err error) {
|
|
|
o := orm.NewOrm()
|