shish 3 gadi atpakaļ
vecāks
revīzija
b5847b2632
1 mainītis faili ar 17 papildinājumiem un 0 dzēšanām
  1. 17 0
      app-ghs/controllers/OrderController.php

+ 17 - 0
app-ghs/controllers/OrderController.php

@@ -35,6 +35,23 @@ class OrderController extends BaseController
     //修改分工 ssh 20221129
     public function actionChangeWorker()
     {
+        $post = Yii::$app->request->post();
+        $id = $post['id'] ?? 0;
+        $shopAdminId = $post['shopAdminId'] ?? 0;
+        $shopAdminName = $post['shopAdminName'] ?? '';
+        $order = OrderClass::getById($id, true);
+        OrderClass::valid($order, $this->shopId);
+
+        $preShopAdminId = $order->shopAdminId ?? 0;
+        if (!empty($preShopAdminId)) {
+            $shopAdmin = $this->shopAdmin;
+            if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+                util::fail('管理员才能操作');
+            }
+        }
+        $order->shopAdminId = $shopAdminId;
+        $order->shopAdminName = $shopAdminName;
+        $order->save();
         util::complete();
     }