|
@@ -219,7 +219,8 @@ type CompanyItem struct {
|
|
|
IsSigning int `description:"是否签约过,1是,0否"`
|
|
|
SigningStatus string `description:"签约状态,已签约过/未签约过"`
|
|
|
CompanyStatusButton *CompanyStatusButton
|
|
|
- Nation string `description:"所属国家"`
|
|
|
+ Nation string `description:"所属国家"`
|
|
|
+ LatestServiceRecord time.Time `description:"最近沟通时间"`
|
|
|
}
|
|
|
|
|
|
type CompanyListItem struct {
|
|
@@ -403,9 +404,15 @@ as sort_todo_end_time,
|
|
|
SUM(b.view_total) as all_view_total,
|
|
|
SUM(b.try_out_day_total) as all_try_out_day_total,
|
|
|
IF(LEFT(GROUP_CONCAT(DISTINCT b.last_view_time ORDER BY b.product_id), 19) >= "` + t + `", 1, 0) AS week_view_active,
|
|
|
- a.nation
|
|
|
+ a.nation,
|
|
|
+ c.latest_service_record
|
|
|
FROM company AS a
|
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT company_id, MAX(create_time) AS latest_service_record
|
|
|
+ FROM company_service_record
|
|
|
+ GROUP BY company_id
|
|
|
+) AS c ON a.company_id = c.company_id
|
|
|
WHERE a.enabled=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
@@ -1964,4 +1971,4 @@ func GetOverseasCompanys() (items []*Company, err error) {
|
|
|
sql := ` SELECT * FROM company where region_type= '海外' `
|
|
|
_, err = o.Raw(sql).QueryRows(&items)
|
|
|
return
|
|
|
-}
|
|
|
+}
|