Преглед изворни кода

Merge branch 'CRM_15.6' into debug

zwxi пре 11 месеци
родитељ
комит
f9b81a6a8c
2 измењених фајлова са 10 додато и 9 уклоњено
  1. 4 2
      controllers/company_share.go
  2. 6 7
      services/statistic_report/company.go

+ 4 - 2
controllers/company_share.go

@@ -332,9 +332,11 @@ func (this *CompanyController) CompanyShareList() {
 		sortStr += fmt.Sprintf(` %s`, sortType)
 	} else {
 		if roleTypeCode == utils.ROLE_TYPE_CODE_ADMIN {
-			sortStr = " ORDER BY sort_status asc, all_view_total desc, a.created_time "
+			//sortStr = " ORDER BY sort_status asc, all_view_total desc, a.created_time "
+			sortStr = " ORDER BY start_date DESC, all_view_total desc, a.created_time "
 		} else {
-			sortStr = " ORDER BY sort_status asc, b.view_total desc, a.created_time  "
+			//sortStr = " ORDER BY sort_status asc, b.view_total desc, a.created_time  "
+			sortStr = " ORDER BY start_date DESC, b.view_total desc, a.created_time "
 		}
 		sortStr += " DESC "
 	}

+ 6 - 7
services/statistic_report/company.go

@@ -137,21 +137,20 @@ func CompanyList(sysUser *system.Admin, req statisticModels.IncrementalCompanyLi
 	} else {
 		//2、客户列表选择“全部”时,支持按照“创建时间”对“全部”分类下所有客户列表进行升降序排列;选择“正式”时按照“转正时间”、选择“冻结”时按照“冻结时间”、选择“流失”时按照“流失时间”、选择“永续”时按照“创建时间”;
 		if status == "全部" || status == "永续" {
-			sortStr = " ORDER BY c.latest_service_record "
+			sortStr = " ORDER BY c.latest_service_record ASC"
 		} else if status == "正式" {
-			sortStr = " ORDER BY b.formal_time "
+			sortStr = " ORDER BY b.formal_time DESC"
 		} else if status == "冻结" {
-			sortStr = " ORDER BY b.freeze_time "
+			sortStr = " ORDER BY b.freeze_time DESC"
 		} else if status == "流失" {
-			sortStr = " ORDER BY b.loss_time "
+			sortStr = " ORDER BY b.loss_time DESC"
 		} else if status == "试用" {
 			if roleTypeCode == utils.ROLE_TYPE_CODE_ADMIN {
-				sortStr = " ORDER BY all_view_total "
+				sortStr = " ORDER BY all_view_total DESC"
 			} else {
-				sortStr = " ORDER BY b.view_total "
+				sortStr = " ORDER BY b.view_total DESC"
 			}
 		}
-		sortStr += " DESC "
 	}
 
 	list, err := company.GetCompanyList(condition, status, sortStr, pars, startSize, pageSize)