|
|
@@ -8,10 +8,8 @@ use bizHd\admin\services\AdminRoleService;
|
|
|
use bizHd\admin\services\ShopAdminService;
|
|
|
use bizHd\wx\services\WxOpenService;
|
|
|
use common\components\imgUtil;
|
|
|
-use common\components\jwt;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
-use yii\web\Controller;
|
|
|
|
|
|
class ShopAdminController extends BaseController
|
|
|
{
|
|
|
@@ -23,6 +21,12 @@ class ShopAdminController extends BaseController
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
$roleId = isset($post['roleId']) ? $post['roleId'] : 0;
|
|
|
+
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if ($shopAdmin['super'] != 1) {
|
|
|
+ util::fail('超管才能操作');
|
|
|
+ }
|
|
|
+
|
|
|
$role = AdminRoleService::getById($roleId);
|
|
|
if (empty($role) || isset($role['merchantId']) != $this->sjId) {
|
|
|
util::fail('请选择角色!');
|
|
|
@@ -95,6 +99,12 @@ class ShopAdminController extends BaseController
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
$id = $post['id'] ?? 0;
|
|
|
+
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if ($shopAdmin['super'] != 1) {
|
|
|
+ util::fail('超管才能操作');
|
|
|
+ }
|
|
|
+
|
|
|
if (empty($id)) {
|
|
|
util::fail('请选择员工');
|
|
|
}
|
|
|
@@ -130,6 +140,12 @@ class ShopAdminController extends BaseController
|
|
|
public function actionDelete()
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
+
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if ($shopAdmin['super'] != 1) {
|
|
|
+ util::fail('超管才能操作');
|
|
|
+ }
|
|
|
+
|
|
|
$relation = ShopAdminClass::getById($id, true);
|
|
|
\biz\shop\classes\ShopAdminClass::deleteShopAdmin($relation, $this->shopAdminId, $this->shopId);
|
|
|
util::complete();
|