Procházet zdrojové kódy

删除员工优化

shish před 5 roky
rodič
revize
0ca4664dca
1 změnil soubory, kde provedl 10 přidání a 0 odebrání
  1. 10 0
      app-pt/controllers/ShopAdminController.php

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

@@ -59,13 +59,23 @@ class ShopAdminController extends BaseController
             $ghsList = GhsClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
             if (!empty($ghsList)) {
                 foreach ($ghsList as $ghs) {
+                    $customId = $ghs->customId;
                     $ghs->delete();
+                    $current = CustomClass::getById($customId);
+                    if (!empty($current)) {
+                        $current->delete();
+                    }
                 }
             }
             $customList = CustomClass::getAllByCondition(['ownSjId' => $sjId], null, '*', null, true);
             if (!empty($customList)) {
                 foreach ($customList as $custom) {
+                    $ghsId = $custom->ghsId;
                     $custom->delete();
+                    $current = GhsClass::getById($ghsId);
+                    if (!empty($current)) {
+                        $current->delete();
+                    }
                 }
             }
             $transaction->commit();