|
|
@@ -155,7 +155,7 @@ class LiveOrderController extends BaseController
|
|
|
//删除客户 ssh 20241005
|
|
|
public function actionDelCustom()
|
|
|
{
|
|
|
- $get= Yii::$app->request->get();
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
$id = $get['id'] ?? 0;
|
|
|
$customId = $get['customId'] ?? 0;
|
|
|
$custom = CustomClass::getById($customId, true);
|
|
|
@@ -184,13 +184,10 @@ class LiveOrderController extends BaseController
|
|
|
{
|
|
|
$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('不是你的客户');
|
|
|
+ $customList = $post['customList'] ?? 0;
|
|
|
+ $customData = json_decode($customList, true);
|
|
|
+ if (empty($customData)) {
|
|
|
+ util::fail('没有客户信息');
|
|
|
}
|
|
|
$live = LiveOrderClass::getById($id, true);
|
|
|
if (empty($live)) {
|
|
|
@@ -202,8 +199,8 @@ class LiveOrderController extends BaseController
|
|
|
if ($live->switchOrder == 1) {
|
|
|
util::fail('已转订单,不能删除');
|
|
|
}
|
|
|
- LiveOrderClass::updateCustom($custom, $live);
|
|
|
- util::complete('添加成功');
|
|
|
+ LiveOrderClass::updateCustom($customData, $live);
|
|
|
+ util::complete('修改成功');
|
|
|
}
|
|
|
|
|
|
}
|