作者 刘锟

update

... ... @@ -214,4 +214,23 @@ class InquiryForwardController extends BaseController
$lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order);
$this->response('success', Code::SUCCESS, $lists);
}
/**
* 停止转发
* @param InquiryForwardLogic $inquiryForwardLogic
* @author Akun
* @date 2025/03/10 10:59
*/
public function stopForwardInquiry(InquiryForwardLogic $inquiryForwardLogic)
{
$this->request->validate([
'id' => 'required',
], [
'id.required' => 'ID不能为空',
]);
$inquiryForwardLogic->stopInquiry();
$this->response('success');
}
}
... ...
... ... @@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo;
use App\Models\Inquiry\InquiryProject;
use App\Models\Inquiry\InquiryProjectRoute;
use App\Models\Inquiry\InquiryRelayDetail;
use App\Models\Inquiry\InquiryRelayDetailLog;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
... ... @@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic
$lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']);
return $this->success($lists);
}
/**
* 停止转发
* @return array
* @throws \App\Exceptions\AsideGlobalException
* @throws \App\Exceptions\BsideGlobalException
* @author Akun
* @date 2025/03/10 11:00
*/
public function stopInquiry()
{
$model = new InquiryRelayDetailLog();
$rs = $model->edit(['status' => InquiryRelayDetailLog::STATUS_STOP], ['detail_id' => $this->param['id']]);
if ($rs === false) {
$this->fail('设置失败');
}
return $this->success();
}
}
... ...
... ... @@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base
protected $table = 'gl_inquiry_relay_detail_log';
/**
* 任务状态, 0:未发送,1:发送中,2:发送成功,9:发送失败
* 任务状态, 0:未发送,1:发送中,2:发送成功,8:停止发送,9:发送失败
*/
const STATUS_INIT = 0;
const STATUS_PEND = 1;
const STATUS_SUCCESS = 2;
const STATUS_STOP = 8;
const STATUS_FAIL = 9;
/**
... ...