浏览代码

后台用户列表,打开状态的排在前面

廖泽华 4 年之前
父节点
当前提交
8aaa78ee04
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      common/models/User.php

+ 2 - 1
common/models/User.php

@@ -13,7 +13,7 @@ use Yii;
13 13
 //use yii\captcha\Captcha;
14 14
 class User extends Common
15 15
 {
16
-
16
+		public $order = 'status ASC';
17 17
         public $repassword; //确认密码
18 18
         public $verifycode;
19 19
 //        public function behaviors()
@@ -74,6 +74,7 @@ class User extends Common
74 74
             $query = self::find();
75 75
             $query->select($field);
76 76
             $query = $this->Setonditions($query);
77
+            $query->orderBy($this->order);
77 78
             if(Yii::$app->session['user_info']['user'] != 'admin'){
78 79
                 $query->andFilterWhere(['not',"user = 'admin'"]);
79 80
             }