|
|
@@ -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('添加成功');
|
|
|
+ }
|
|
|
+
|
|
|
}
|