|
@@ -2,10 +2,14 @@ |
|
@@ -2,10 +2,14 @@ |
|
2
|
|
2
|
|
|
3
|
namespace App\Http\Controllers\Api;
|
3
|
namespace App\Http\Controllers\Api;
|
|
4
|
|
4
|
|
|
|
|
5
|
+use App\Enums\Common\Code;
|
|
5
|
use App\Exceptions\InquiryFilterException;
|
6
|
use App\Exceptions\InquiryFilterException;
|
|
6
|
use App\Models\SyncSubmitTask\SyncSubmitTask;
|
7
|
use App\Models\SyncSubmitTask\SyncSubmitTask;
|
|
|
|
8
|
+use App\Models\Visit\Visit;
|
|
7
|
use App\Services\CosService;
|
9
|
use App\Services\CosService;
|
|
|
|
10
|
+use App\Services\ProjectServer;
|
|
8
|
use Illuminate\Http\Request;
|
11
|
use Illuminate\Http\Request;
|
|
|
|
12
|
+use Illuminate\Support\Facades\DB;
|
|
9
|
|
13
|
|
|
10
|
/**
|
14
|
/**
|
|
11
|
* Class InquiryController
|
15
|
* Class InquiryController
|
|
@@ -51,4 +55,39 @@ class InquiryController extends BaseController |
|
@@ -51,4 +55,39 @@ class InquiryController extends BaseController |
|
51
|
}
|
55
|
}
|
|
52
|
return $this->success();
|
56
|
return $this->success();
|
|
53
|
}
|
57
|
}
|
|
|
|
58
|
+
|
|
|
|
59
|
+ /**
|
|
|
|
60
|
+ * @remark :修改路由状态
|
|
|
|
61
|
+ * @name :editInquiryStatus
|
|
|
|
62
|
+ * @author :lyh
|
|
|
|
63
|
+ * @method :post
|
|
|
|
64
|
+ * @time :2024/3/22 15:31
|
|
|
|
65
|
+ */
|
|
|
|
66
|
+ public function editInquiryStatus(){
|
|
|
|
67
|
+ $this->request->validate([
|
|
|
|
68
|
+ 'project_id'=>'required',
|
|
|
|
69
|
+ 'ip'=>'required',
|
|
|
|
70
|
+ 'updated_date'=>'required',
|
|
|
|
71
|
+ ],[
|
|
|
|
72
|
+ 'project_id.required' => 'project_id不能为空',
|
|
|
|
73
|
+ 'ip.required' => 'ip不能为空',
|
|
|
|
74
|
+ 'updated_date.required' => '日期不能为空',
|
|
|
|
75
|
+ ]);
|
|
|
|
76
|
+ ProjectServer::useProject($this->param['project_id']);
|
|
|
|
77
|
+ $customerVisitModel = new Visit();
|
|
|
|
78
|
+ $info = $customerVisitModel->read([
|
|
|
|
79
|
+ 'ip'=>$this->param['ip'],
|
|
|
|
80
|
+ 'updated_date'=>$this->param['updated_date']
|
|
|
|
81
|
+ ]);
|
|
|
|
82
|
+ if($info === false){
|
|
|
|
83
|
+ $this->response('当前记录不存在',Code::SYSTEM_ERROR);
|
|
|
|
84
|
+ }
|
|
|
|
85
|
+ try {
|
|
|
|
86
|
+ $customerVisitModel->edit(['is_inquiry'=>1],['id'=>$info['id']]);
|
|
|
|
87
|
+ }catch (\Exception $e){
|
|
|
|
88
|
+ $this->response('操作失败',Code::SYSTEM_ERROR);
|
|
|
|
89
|
+ }
|
|
|
|
90
|
+ DB::disconnect('custom_mysql');
|
|
|
|
91
|
+ $this->response('success');
|
|
|
|
92
|
+ }
|
|
54
|
} |
93
|
} |