| xqd
@@ -108,7 +108,10 @@ class UserController extends Controller
|
|
|
{
|
|
|
if(Request::method() == 'POST'){
|
|
|
$data = Request::input('info');
|
|
|
- // $data['store_id'] = $this->getStoreId();
|
|
|
+ if ($this->_user['is_root'] != 1) {
|
|
|
+ $data['store_id'] = $this->getStoreId();
|
|
|
+ }
|
|
|
+
|
|
|
if(isset($data['admin_role_id']))$data['admin_role_id'] = implode(',', $data['admin_role_id']);
|
|
|
if($this->_service->create($data)){
|
|
|
$this->showMessage('操作成功', urldecode(Request::input('_referer')));
|
| xqd
@@ -117,8 +120,8 @@ class UserController extends Controller
|
|
|
}
|
|
|
}
|
|
|
$data = $this->_service->find(Request::input('id'));
|
|
|
-
|
|
|
- if($this->_user['is_root']){
|
|
|
+ $data['is_root'] = $this->_user['is_root'];
|
|
|
+ if($this->_user['is_root']) {
|
|
|
$roles = $this->_getRoles();
|
|
|
}else{
|
|
|
$roles = $this->_getCurrentRoles();
|
| xqd
@@ -138,6 +141,9 @@ class UserController extends Controller
|
|
|
if ($data['password'] == null) {
|
|
|
unset($data['password']);
|
|
|
}
|
|
|
+ if ($this->_user['is_root'] != 1) {
|
|
|
+ $data['store_id'] = $this->getStoreId();
|
|
|
+ }
|
|
|
// dd($data);
|
|
|
if(isset($data['admin_role_id']))$data['admin_role_id'] = implode(',', $data['admin_role_id']);
|
|
|
if($this->_service->update(Request::input('id'), $data)){
|
| xqd
@@ -147,7 +153,7 @@ class UserController extends Controller
|
|
|
}
|
|
|
}
|
|
|
$data = $this->_service->find(Request::input('id'));
|
|
|
-
|
|
|
+ $data['is_root'] = $this->_user['is_root'];
|
|
|
if($this->_user['is_root']){
|
|
|
$roles = $this->_getRoles();
|
|
|
}else{
|