|
@@ -15,9 +15,9 @@ type CygxActivityVoiceHistory struct {
|
|
|
CompanyId int `description:"公司id"`
|
|
|
CompanyName string `description:"公司名称"`
|
|
|
RealName string `description:"用户实际名称"`
|
|
|
- SellerName string `description:"所属销售"`
|
|
|
- PlaySeconds string `description:"播放时间 单位s"`
|
|
|
- ModifyTime time.Time `description:"视频修改时间"`
|
|
|
+ SellerName string `description:"所属销售"`
|
|
|
+ PlaySeconds string `description:"播放时间 单位s"`
|
|
|
+ ModifyTime time.Time `description:"视频修改时间"`
|
|
|
}
|
|
|
|
|
|
//添加
|
|
@@ -39,4 +39,26 @@ func UpdateLastCygxActivityVoiceHistory(playSeconds string, lastId int) (err err
|
|
|
sql := ` UPDATE cygx_activity_voice_history SET play_seconds =? WHERE id=? `
|
|
|
_, err = o.Raw(sql, playSeconds, lastId).Exec()
|
|
|
return
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+//获取列表信息根据手机号分组
|
|
|
+func GetActivityVoiceHistoryByMobileList(condition string) (items []*CygxActivityVoiceHistory, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM cygx_activity_voice_history WHERE 1 =1 ` + condition + ` GROUP BY user_id `
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+//修改用户浏览活动音频的相关信息
|
|
|
+func UpdateCygxActivityVoiceHistory(wxUser *WxUserItem) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ var sql string
|
|
|
+ if wxUser.Mobile != "" {
|
|
|
+ sql = `UPDATE cygx_activity_voice_history SET email=?,company_id=?,company_name=?,user_id=?,real_name=? WHERE mobile=? `
|
|
|
+ _, err = o.Raw(sql, wxUser.Email, wxUser.CompanyId, wxUser.CompanyName, wxUser.UserId, wxUser.RealName, wxUser.Mobile).Exec()
|
|
|
+ } else if wxUser.Email != "" {
|
|
|
+ sql = `UPDATE cygx_activity_voice_history SET mobile=?,company_id=?,company_name=?,user_id=?,real_name=? WHERE email=? `
|
|
|
+ _, err = o.Raw(sql, wxUser.Mobile, wxUser.CompanyId, wxUser.CompanyName, wxUser.UserId, wxUser.RealName, wxUser.Email).Exec()
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|