|
|
@@ -41,6 +41,12 @@ class ShopAdminController extends BaseController
|
|
|
//添加员工
|
|
|
public function actionAddStaff()
|
|
|
{
|
|
|
+
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
+ util::fail('没有权限');
|
|
|
+ }
|
|
|
+
|
|
|
$post = Yii::$app->request->post();
|
|
|
$authCode = $post['authCode'] ?? '';
|
|
|
$mobile = $post['mobile'] ?? '';
|
|
|
@@ -178,9 +184,9 @@ class ShopAdminController extends BaseController
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'] ?? 0;
|
|
|
|
|
|
- $shopAdmin = $this->shopAdmin->attributes;
|
|
|
- if ($shopAdmin['super'] != 1) {
|
|
|
- util::fail('超管才能操作');
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
+ util::fail('没有权限');
|
|
|
}
|
|
|
|
|
|
if (empty($id)) {
|
|
|
@@ -195,9 +201,11 @@ class ShopAdminController extends BaseController
|
|
|
$roleId = $post['roleId'] ?? 0;
|
|
|
$remind = $post['remind'] ?? 0;
|
|
|
$status = $post['status'] ?? 1;
|
|
|
+ $super = $post['super'] ?? 0;
|
|
|
$relation->roleId = $roleId;
|
|
|
$relation->remind = $remind;
|
|
|
$relation->status = $status;
|
|
|
+ $relation->super = $super;
|
|
|
if (isset($post['name']) && !empty($post['name'])) {
|
|
|
$relation->name = $post['name'];
|
|
|
}
|