Jelajahi Sumber

优化删除操作

shish 5 tahun lalu
induk
melakukan
100d35b0fa
1 mengubah file dengan 14 tambahan dan 0 penghapusan
  1. 14 0
      app-pt/controllers/ShopAdminController.php

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

@@ -3,8 +3,10 @@
 namespace pt\controllers;
 
 use biz\admin\classes\AdminClass;
+use biz\ghs\classes\GhsClass;
 use biz\shop\classes\ShopAdminClass;
 use biz\sj\classes\SjClass;
+use bizGhs\custom\classes\CustomClass;
 use bizHd\admin\services\ShopAdminService;
 use bizHd\saas\classes\ApplyClass;
 use common\components\util;
@@ -54,6 +56,18 @@ class ShopAdminController extends BaseController
             if (!empty($shopAdmin)) {
                 $shopAdmin->delete();
             }
+            $ghsList = GhsClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
+            if (!empty($ghsList)) {
+                foreach ($ghsList as $ghs) {
+                    $ghs->delete();
+                }
+            }
+            $customList = CustomClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
+            if (!empty($customList)) {
+                foreach ($customList as $custom) {
+                    $custom->delete();
+                }
+            }
             $transaction->commit();
             util::complete();
         } catch (Exception $exception) {