Ver Fonte

更新客户

shish há 1 ano atrás
pai
commit
2d94498be8

+ 27 - 0
app-ghs/controllers/LiveOrderController.php

@@ -179,4 +179,31 @@ class LiveOrderController extends BaseController
         util::complete('添加成功');
     }
 
+    //更新客户 ssh 20241005
+    public function actionUpdateCustom()
+    {
+        $post = Yii::$app->request->post();
+        $id = $post['id'] ?? 0;
+        $customId = $post['customId'] ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        if (empty($custom)) {
+            util::fail('没有找到客户');
+        }
+        if ($custom->ownMainId != $this->mainId) {
+            util::fail('不是你的客户');
+        }
+        $live = LiveOrderClass::getById($id, true);
+        if (empty($live)) {
+            util::fail('没有找到记录');
+        }
+        if ($live->mainId != $this->mainId) {
+            util::fail('不是你的记录');
+        }
+        if ($live->switchOrder == 1) {
+            util::fail('已转订单,不能删除');
+        }
+        LiveOrderClass::updateCustom($custom, $live);
+        util::complete('添加成功');
+    }
+
 }

+ 5 - 0
biz-ghs/live/classes/LiveOrderClass.php

@@ -13,6 +13,11 @@ class LiveOrderClass extends BaseClass
 
     public static $baseFile = '\bizGhs\live\models\LiveOrder';
 
+    public static function updateCustom()
+    {
+
+    }
+
     public static function delCustom($custom, $live)
     {
         $customId = $custom->id ?? 0;