|
@@ -25,7 +25,7 @@ type EnglishReportEmailController struct {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -62,18 +62,12 @@ func (this *EnglishReportEmailController) List() {
|
|
|
pars = append(pars, k, k)
|
|
|
}
|
|
|
|
|
|
- if sortParam == 1 {
|
|
|
- if sortType == 1 {
|
|
|
- order = ` ORDER BY a.view_total DESC`
|
|
|
- } else {
|
|
|
- order = ` ORDER BY a.view_total ASC`
|
|
|
- }
|
|
|
- } else {
|
|
|
- if sortType == 1 {
|
|
|
- order = ` ORDER BY a.create_time DESC`
|
|
|
- } else {
|
|
|
- order = ` ORDER BY a.create_time ASC`
|
|
|
- }
|
|
|
+ sortParamArr := []int{1, 2, 3}
|
|
|
+ sortTypeArr := []int{1, 2}
|
|
|
+ if utils.InArrayByInt(sortParamArr, sortParam) && utils.InArrayByInt(sortTypeArr, sortType) {
|
|
|
+ pMap := map[int]string{1: "a.view_total", 2: "a.last_view_time", 3: "a.enabled"}
|
|
|
+ tMap := map[int]string{1: "DESC", 2: "ASC"}
|
|
|
+ order = fmt.Sprintf(` ORDER BY %s %s`, pMap[sortParam], tMap[sortType])
|
|
|
}
|
|
|
|
|
|
if listParam == 1 {
|