Commit 8586a7e8 authored by 张晓林's avatar 张晓林

获取用户组

parent 932c8bc3
...@@ -40,12 +40,15 @@ class ShopUserListController extends BaseController ...@@ -40,12 +40,15 @@ class ShopUserListController extends BaseController
$param = Yii::$app->request->get(); $param = Yii::$app->request->get();
$ShopUserList = new ShopUserList(); $ShopUserList = new ShopUserList();
$userList = $ShopUserList->getUserList($param); $userList = $ShopUserList->getUserList($param);
$data['userList'] = $userList;
//获取所有用户组
$data['memberGradeList'] = $this->getMemberGradeList();
if(empty($userList)){ if(empty($userList)){
throw new BadRequestHttpException('未找到查询数据'); throw new BadRequestHttpException('未找到查询数据');
} }
return [ return [
'CODE'=>200, 'CODE'=>200,
'DATA'=>$userList 'DATA'=>$data
]; ];
} }
...@@ -83,7 +86,7 @@ class ShopUserListController extends BaseController ...@@ -83,7 +86,7 @@ class ShopUserListController extends BaseController
]; ];
$data['userInfo'] = $model::find()->select($userColumn)->where(['GUID'=>$param['GUID']])->asArray()->one(); $data['userInfo'] = $model::find()->select($userColumn)->where(['GUID'=>$param['GUID']])->asArray()->one();
//获取所有用户组 //获取所有用户组
$data['memberGradeList'] = ShopUserMembergrade::find()->select(['GUID','NAME'])->asArray()->all(); $data['memberGradeList'] = $this->getMemberGradeList();
//获取用户所在用户组 //获取用户所在用户组
if(!empty($data['userInfo'])){ if(!empty($data['userInfo'])){
$data['userMemberGradeList'] = $model::find() $data['userMemberGradeList'] = $model::find()
...@@ -139,4 +142,10 @@ class ShopUserListController extends BaseController ...@@ -139,4 +142,10 @@ class ShopUserListController extends BaseController
public function actionUserUpdate(){ public function actionUserUpdate(){
} }
public function getMemberGradeList(){
//获取所有用户组
$list = ShopUserMembergrade::find()->select(['GUID','NAME'])->asArray()->all();
return $list;
}
} }
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