|
...
|
...
|
@@ -6,6 +6,7 @@ use App\Enums\Common\Code; |
|
|
|
use App\Http\Controllers\Aside\BaseController;
|
|
|
|
use App\Http\Logic\Aside\Projects\InquiryInfoLogic;
|
|
|
|
use App\Models\Projects\InquiryUser;
|
|
|
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :询盘中心
|
|
...
|
...
|
@@ -29,20 +30,6 @@ class InquiryInfoController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存询盘信息
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/11 15:33
|
|
|
|
*/
|
|
|
|
public function save(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
//参数验证
|
|
|
|
$this->validationParam();
|
|
|
|
$inquiryInfoLogic->inquirySave();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :参数验证
|
|
|
|
* @name :validationParam
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -72,11 +59,92 @@ class InquiryInfoController extends BaseController |
|
|
|
'type.required' => '类型不能为空',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @remark :保存询盘信息
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/11 15:33
|
|
|
|
*/
|
|
|
|
public function save(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
//参数验证
|
|
|
|
$this->validationParam();
|
|
|
|
$inquiryInfoLogic->inquirySave();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :转发详情
|
|
|
|
* @name :info
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/12 17:19
|
|
|
|
*/
|
|
|
|
public function forwardInfo(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',//
|
|
|
|
],[
|
|
|
|
'id.required' => 'ID不能为空',
|
|
|
|
]);
|
|
|
|
$info = $inquiryInfoLogic->inquiryForwardInfo();
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param InquiryInfoLogic $inquiryInfoLogic
|
|
|
|
* @remark :执行逻辑删除
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/12 14:10
|
|
|
|
*/
|
|
|
|
public function del(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id'=>'required',//
|
|
|
|
],[
|
|
|
|
'id.required' => '名称不能为空',
|
|
|
|
|
|
|
|
]);
|
|
|
|
$inquiryInfoLogic->inquiryInfoDel();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ceshi(){
|
|
|
|
$inquiryUser = new InquiryUser();
|
|
|
|
for ($i = 0;$i <= 200;$i++){
|
|
|
|
$inquiryUser->edit(['xp_id'=>$i + 1],['id'=>$i + 1]);
|
|
|
|
/**
|
|
|
|
* @remark :导入询盘记录
|
|
|
|
* @name :ImportInquirySave
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/13 10:39
|
|
|
|
*/
|
|
|
|
public function importInquirySave(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
if ($this->request->hasFile('file')) {
|
|
|
|
$path = $this->request->file('file')->getRealPath();
|
|
|
|
$spreadsheet = IOFactory::load($path);
|
|
|
|
$worksheet = $spreadsheet->getActiveSheet();
|
|
|
|
$rows = $worksheet->toArray();
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
// 创建模型实例并设置属性
|
|
|
|
$inquiryInfoLogic->ImportInquiryInfoSave($row);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :根据国家获取随机ip
|
|
|
|
* @name :getSearchIpInfo
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/13 13:45
|
|
|
|
*/
|
|
|
|
public function getSearchIpInfo(InquiryInfoLogic $inquiryInfoLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'ip_area'=>'required',//
|
|
|
|
],[
|
|
|
|
'ip_area.required' => '国家不能为空',
|
|
|
|
|
|
|
|
]);
|
|
|
|
$info = $inquiryInfoLogic->getSearchIp();
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|