shish 9 месяцев назад
Родитель
Сommit
4ced90a5be
1 измененных файлов с 4 добавлено и 3 удалено
  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) {