zhangl 4 달 전
부모
커밋
953a81bc6f
2개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      frontendApi/modules/v1/controllers/ArticleController.php
  2. 1 2
      frontendApi/modules/v1/controllers/DashboardController.php

+ 1 - 2
frontendApi/modules/v1/controllers/ArticleController.php

@@ -28,8 +28,7 @@ class ArticleController extends BaseController
             $value['LISTS']=Article::find()
                 ->select('ID,TITLE,CID,CREATED_AT')
                 ->where('CID=:CID AND STATUS=1 AND COUNTRY_ID=:COUNTRY_ID', [':CID'=>$value['ID'], ':COUNTRY_ID'=>$baseInfo['COUNTRY_ID']])
-                ->orderBy('SORT DESC')
-                ->orderBy('CREATED_AT DESC')
+                ->orderBy('SORT DESC, CREATED_AT DESC')
                 ->limit(5)
                 ->asArray()
                 ->all();

+ 1 - 2
frontendApi/modules/v1/controllers/DashboardController.php

@@ -58,8 +58,7 @@ class DashboardController extends BaseController
             $value['LISTS'] = Article::find()
                 ->select('ID,TITLE,CID,CREATED_AT')
                 ->where($where, $params)
-                ->orderBy('SORT DESC')
-                ->orderBy('CREATED_AT DESC')
+                ->orderBy('SORT DESC, CREATED_AT DESC')
                 ->limit(6)
                 ->asArray()
                 ->all();