shish 5 年之前
父节点
当前提交
6d8ae85a53
共有 2 个文件被更改,包括 41 次插入1 次删除
  1. 1 1
      app-mall/controllers/UserController.php
  2. 40 0
      app-pt/controllers/ShopAdminController.php

+ 1 - 1
app-mall/controllers/UserController.php

@@ -24,7 +24,7 @@ class UserController extends BaseController
     {
         $list = UserClass::getRecentShop($this->user);
         //0最近访问的门店 1国兰门店信息
-        util::success(['list' => $list, 'showIndex' => 1]);
+        util::success(['list' => $list, 'showIndex' => 0]);
     }
 
     //获取登陆客户的资产 ssh 2019.11.22

+ 40 - 0
app-pt/controllers/ShopAdminController.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace pt\controllers;
+
+use biz\admin\classes\AdminClass;
+use biz\shop\classes\ShopAdminClass;
+use bizHd\admin\services\ShopAdminService;
+use bizHd\saas\classes\ApplyClass;
+use common\components\util;
+
+
+class ShopAdminController extends BaseController
+{
+
+    //员工列表 ssh 2019.12.8
+    public function actionList()
+    {
+        $where = [];
+        $where['delStatus'] = 0;
+        $list = ShopAdminService::getAdminList($where);
+        util::success($list);
+    }
+
+    //删除员工、商家、和申请信息 shish
+    public function actionDelete()
+    {
+        $id = Yii::$app->request->get('id');
+        $admin = ShopAdminClass::getAdminInfo($id);
+        if (empty($admin)) {
+            util::fail('没有找到员工');
+        }
+        $adminId = $admin['adminId'] ?? 0;
+        $sjId = $admin['merchantId'] ?? 0;
+        ApplyClass::deleteByCondition(['sjId' => $sjId]);
+        AdminClass::deleteById($adminId);
+        ShopAdminClass::deleteById($id);
+        util::complete();
+    }
+
+}