林琦海 пре 5 година
родитељ
комит
8ce070aa07

+ 2 - 1
app-ghs/controllers/PurchaseOrderController.php

@@ -28,7 +28,8 @@ class PurchaseOrderController extends BaseController
         if(!is_array($ghsItemInfo)){
             util::fail('花材格式不正确');
         }
-
+        //合并
+        $ghsItemInfo = PurchaseOrderClass::mergeItemInfo($ghsItemInfo);
         //判断花材格式,是否属于当前门店
         ProductClass::valid($ghsItemInfo,$this->shopId);
         //获取供应商信息

+ 2 - 2
app-ghs/controllers/ShopAdminController.php

@@ -139,8 +139,8 @@ class ShopAdminController extends BaseController
     {
         $id = Yii::$app->request->get('id');
         $relation = ShopAdminClass::getInfo($id);
-        if ($relation['super'] == 1) {
-            //util::fail("管理员不能删除");
+        if ($relation['founder'] == 2) {
+            util::fail("创始人不能删除");
         }
         ShopAdminClass::valid($relation, $this->shopId);
         ShopAdminClass::delRelation($relation);

+ 14 - 2
app-hd/controllers/ShopAdminController.php

@@ -3,7 +3,7 @@
 namespace hd\controllers;
 
 use biz\admin\classes\AdminClass;
-use biz\shop\classes\ShopAdminClass;
+use bizGhs\shop\classes\ShopAdminClass;
 use bizHd\admin\services\AdminRoleService;
 use bizHd\admin\services\ShopAdminService;
 use bizHd\wx\services\WxOpenService;
@@ -126,4 +126,16 @@ class ShopAdminController extends BaseController
         util::complete('修改成功');
     }
 
-}
+    //删除员工关系 ssh 2021.1.14
+    public function actionDelete()
+    {
+        $id = Yii::$app->request->get('id');
+        $relation = ShopAdminClass::getInfo($id);
+        if ($relation['founder'] == 2) {
+            util::fail("创始人不能删除");
+        }
+        ShopAdminClass::valid($relation, $this->shopId);
+        ShopAdminClass::delRelation($relation);
+        util::complete();
+    }
+}

+ 10 - 0
biz-ghs/shop/classes/ShopAdminClass.php

@@ -90,6 +90,16 @@ class ShopAdminClass extends BaseClass
         return self::getById($id);
     }
 
+    //获取基本信息 shish 2021.4.23
+    public static function getAdminInfo($id)
+    {
+        $relation = self::getById($id);
+        if (empty($relation)) {
+            util::fail('没有找到员工信息');
+        }
+        return $relation;
+    }
+
     //删除员工关系 ssh 2021.3.27
     public static function delRelation($relation)
     {