|
@@ -32,6 +32,7 @@ type EnglishCompany struct {
|
|
|
OverseasStatus string `description:"海外客户状态:'正式','试用','关闭'"`
|
|
|
OverseasLabel int `description:"海外客户试用子标签:1未分类、2 推进、3 跟踪、4 预备、"`
|
|
|
RoadShowTotal int `description:"累计路演次数"`
|
|
|
+ LastViewTime string `description:"最后一次阅读时间"`
|
|
|
}
|
|
|
|
|
|
// 获取客户路演数据
|
|
@@ -57,9 +58,27 @@ func (obj *Custom) GetEnglishCompanyAll() (list []*EnglishCompany, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func (obj *Custom) UpdateRoadShowTotal(companyId, total int) (err error) {
|
|
|
+func (obj *Custom) UpdateEnglishCompanyRoadShowTotal(companyId, total int) (err error) {
|
|
|
o := orm.NewOrmUsingDB("rddp")
|
|
|
sql := ` UPDATE english_company SET road_show_total=? WHERE company_id=? `
|
|
|
_, err = o.Raw(sql, total, companyId).Exec()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 获取客户路演数据
|
|
|
+func (obj *Custom) GetEnglishCompanyLastViewTime() (list []*EnglishCompany, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ sql := ` SELECT b.company_id,MAX(a.create_time) AS last_view_time
|
|
|
+ FROM english_report_email_pv AS a
|
|
|
+ INNER JOIN english_report_email AS b ON a.email_id=b.id
|
|
|
+ GROUP BY b.company_id `
|
|
|
+ _, err = o.Raw(sql).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+func (obj *Custom) UpdateEnglishCompanyLastViewTime(companyId int, lastViewTime string) (err error) {
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ sql := ` UPDATE english_company SET last_view_time=? WHERE company_id=? `
|
|
|
+ _, err = o.Raw(sql, lastViewTime, companyId).Exec()
|
|
|
+ return
|
|
|
+}
|