Commit 4749f56f authored by 孙磊's avatar 孙磊

role

Signed-off-by: 孙磊's avatarsunlei <sunlei@romens.cn>
parent 32882ff8
...@@ -6,6 +6,7 @@ use Yii; ...@@ -6,6 +6,7 @@ use Yii;
use yii\web\IdentityInterface; use yii\web\IdentityInterface;
use app\models\v1\BaseModel; use app\models\v1\BaseModel;
use yii\web\HttpException; use yii\web\HttpException;
use yii\data\ActiveDataProvider;
/** /**
* This is the model class for table "shop_rbac_role". * This is the model class for table "shop_rbac_role".
...@@ -60,4 +61,23 @@ class ShopRbacRole extends BaseModel ...@@ -60,4 +61,23 @@ class ShopRbacRole extends BaseModel
'SORT' => 'Sort', 'SORT' => 'Sort',
]; ];
} }
//获取角色列表
public function getAuthorityRoles($ID)
{
$query = static::find()
->select('ID,NAME,PID,STATUS,REMARK,SORT')
->where(['STATUS' => 1])
->orderBy('SORT ASC');
if(isset($ID) && !empty($ID)){
$query->andFilterWhere(['=','ID',$ID]);
}
return new ActiveDataProvider([
'query' => $query->asArray(),
'pagination' => [
'pageSize' => PAGE_SIZE
]
]);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment