作者 lyh

gx

... ... @@ -74,6 +74,10 @@ class InquiryDelay extends Command
$post_data_new['submit_time'] = date('Y-m-d H:i:s',time()+20);
$token = md5($post_data_new['refer'].$post_data_new['name'].$post_data_new['ip'].date("Y-m-d",time()));
$post_data_new['token'] = $token;
return http_post($url,$post_data_new);
$header = array(
'CLIENT-IP: '.$post_data['ip'],
'X-FORWARDED-FOR: '.$post_data['ip']
);
return http_post($url,$post_data_new,$header);
}
}
... ...
... ... @@ -70,7 +70,6 @@ if (!function_exists('http_post')) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
}
curl_close($ch);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
return json_decode($res, true);
}
}
... ...
... ... @@ -100,7 +100,7 @@ class BaseController extends Controller
$this->map['updated_at'] = ['between', $this->_btw];
break;
default:
if (!empty($v)) {
if (!empty($v) || $v == 0) {
$this->map[$k] = $v;
}
break;
... ...
... ... @@ -171,4 +171,23 @@ class InquiryInfoController extends BaseController
$inquiryInfoLogic->forwardTime($this->param['id']);
$this->response('success');
}
/**
* @remark :修改状态
* @name :status
* @author :lyh
* @method :post
* @time :2023/7/14 15:20
*/
public function status(InquiryInfoLogic $inquiryInfoLogic){
$this->request->validate([
'id'=>'required',
'status'=>'required',
],[
'id.required' => 'id不能为空',
'status.required' => '状态不能为空',
]);
$inquiryInfoLogic->inquiryEdit();
$this->response('success');
}
}
... ...
... ... @@ -54,13 +54,12 @@ class InquiryInfoLogic extends BaseLogic
$this->param['created_at'] = date('Y-m-d H:i:s');
$this->param['updated_at'] = date('Y-m-d H:i:s');
$xp_id = $this->model->insertGetId($this->param);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($xp_id, true) . PHP_EOL, FILE_APPEND);
// @file_put_contents(storage_path('logs/lyh_error.log'), var_export($xp_id, true) . PHP_EOL, FILE_APPEND);
if(!$xp_id){
$this->fail('error');
}
//延时时间为0时,询盘转发
if($this->param['delay'] == 0){
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('debug---------------1', true) . PHP_EOL, FILE_APPEND);
$this->forwardTime($xp_id);
}
return $this->success();
... ... @@ -193,7 +192,24 @@ class InquiryInfoLogic extends BaseLogic
'CLIENT-IP: '.$post_data['ip'],
'X-FORWARDED-FOR: '.$post_data['ip']
);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(json_encode($post_data_new).'debug---------------55555', true) . PHP_EOL, FILE_APPEND);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(json_encode($post_data_new).'debug', true) . PHP_EOL, FILE_APPEND);
return http_post($url,$post_data_new,$header);
}
/**
* @remark :更新询盘状态
* @name :inquiryEdit
* @author :lyh
* @method :post
* @time :2023/7/14 15:19
*/
public function inquiryEdit(){
$this->param['user_id'] = $this->manager['id'];
$this->param['user_name'] = $this->manager['name'];
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
}
... ...