|
|
@@ -42,8 +42,13 @@ class DashboardController extends BaseController
|
|
|
*/
|
|
|
public function actionIndex(){
|
|
|
$nowTime = Date::nowTime();
|
|
|
- $baseInfo=Info::baseInfoZh(\Yii::$app->user->id);
|
|
|
- $news=ArticleCategory::find()->select('ID,CATE_NAME')->orderBy('SORT ASC')->orderBy('CREATED_AT DESC')->asArray()->all();
|
|
|
+ $baseInfo = Info::baseInfoZh(\Yii::$app->user->id);
|
|
|
+ $news = ArticleCategory::find()
|
|
|
+ ->select('ID,CATE_NAME')
|
|
|
+ ->orderBy('CREATED_AT DESC')
|
|
|
+ ->asArray()
|
|
|
+ ->all();
|
|
|
+
|
|
|
$where = ' CID=:CID AND STATUS=1 AND COUNTRY_ID=:COUNTRY_ID';
|
|
|
foreach ($news as &$value){
|
|
|
$params = [
|
|
|
@@ -52,7 +57,8 @@ class DashboardController extends BaseController
|
|
|
];
|
|
|
$value['LISTS'] = Article::find()
|
|
|
->select('ID,TITLE,CID,CREATED_AT')
|
|
|
- ->where($where,$params)
|
|
|
+ ->where($where, $params)
|
|
|
+ ->orderBy('SORT DESC')
|
|
|
->orderBy('CREATED_AT DESC')
|
|
|
->limit(6)
|
|
|
->asArray()
|