shish 8 mesi fa
parent
commit
4ced90a5be
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 4 3
      app-ghs/controllers/ShopAdminController.php

+ 4 - 3
app-ghs/controllers/ShopAdminController.php

@@ -46,9 +46,6 @@ class ShopAdminController extends BaseController
         $transaction = $connection->beginTransaction();
         try {
 
-            $staff->founder = 2;
-            $staff->save();
-
             $newAdminId = $staff->adminId;
 
             $mainId = $staff->mainId;
@@ -66,6 +63,10 @@ class ShopAdminController extends BaseController
                     ShopAdminClass::updateByCondition(['mainId' => $mainId, 'adminId' => $adminId], ['founder' => 1]);
                 }
             }
+
+            $staff->founder = 2;
+            $staff->save();
+
             $transaction->commit();
             util::complete('操作成功');
         } catch (\Exception $e) {