|
@@ -32,12 +32,12 @@ func AddctivitySignupDetail(cont context.Context) (err error) {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
if actLen > 0 {
|
|
|
- //condition += ` AND activity_id IN (` + utils.GetOrmInReplace(actLen) + `)`
|
|
|
- //pars = append(pars, activityIds)
|
|
|
+ condition += ` AND activity_id IN (` + utils.GetOrmInReplace(actLen) + `)`
|
|
|
+ pars = append(pars, activityIds)
|
|
|
} else {
|
|
|
return err
|
|
|
}
|
|
|
- condition = ""
|
|
|
+ //condition = ""
|
|
|
//获取当天已经结束了 活动的报名人数
|
|
|
signUpList, err := models.GetSignupDetailBySignup(condition, pars)
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
@@ -66,6 +66,7 @@ func AddctivitySignupDetail(cont context.Context) (err error) {
|
|
|
item.ActivityId = v.ActivityId
|
|
|
item.CreateTime = v.CreateTime
|
|
|
item.Mobile = v.Mobile
|
|
|
+ item.OutboundMobile = v.OutboundMobile
|
|
|
item.Email = v.Email
|
|
|
item.CompanyId = v.CompanyId
|
|
|
item.CompanyName = v.CompanyName
|
|
@@ -123,6 +124,20 @@ func AddctivitySignupDetailByJmcj(itemsDetail []*models.CygxActivityAttendanceDe
|
|
|
mapsignUpDetai[fmt.Sprint("ActivityId", v.ActivityId, "Mobile", v.Mobile)] = v.Mobile
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //获取当天已经结束了 活动的报名人数
|
|
|
+ signUpList, err := models.GetSignupDetailBySignup(condition, pars)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ //建立外呼号与手机号的绑定
|
|
|
+ mapsignUp := make(map[string]string)
|
|
|
+ if len(signUpList) > 0 {
|
|
|
+ for _, v := range signUpList {
|
|
|
+ mapsignUp[fmt.Sprint(v.OutboundMobile)] = v.Mobile
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var itemsAdd []*models.CygxActivitySignupDetail
|
|
|
var itemsUpdate []*models.CygxActivitySignupDetail
|
|
|
|
|
@@ -130,7 +145,13 @@ func AddctivitySignupDetailByJmcj(itemsDetail []*models.CygxActivityAttendanceDe
|
|
|
var item = new(models.CygxActivitySignupDetail)
|
|
|
item.ActivityId = v.ActivityId
|
|
|
item.RealName = v.RealName
|
|
|
- item.Mobile = v.Mobile
|
|
|
+ //如果手机号存在那么就是报名的,不存在就是直接参与的
|
|
|
+ if _, ok := mapsignUp[v.Mobile]; ok {
|
|
|
+ item.Mobile = mapsignUp[v.Mobile]
|
|
|
+ } else {
|
|
|
+ item.Mobile = v.Mobile
|
|
|
+ }
|
|
|
+ item.OutboundMobile = v.Mobile
|
|
|
item.CompanyName = v.CompanyName
|
|
|
item.CompanyId = v.CompanyId
|
|
|
item.SellerName = v.SellerName
|
|
@@ -171,6 +192,9 @@ func AddctivitySignupDetailByJmcj(itemsDetail []*models.CygxActivityAttendanceDe
|
|
|
|
|
|
return err
|
|
|
}
|
|
|
+func init() {
|
|
|
+ GetCygxActivityAttendanceDetail()
|
|
|
+}
|
|
|
|
|
|
func GetCygxActivityAttendanceDetail() {
|
|
|
listAll, err := models.GetActivityAttendanceDetailListAll()
|