作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

... ... @@ -996,14 +996,16 @@ class RelayInquiry extends Command
//按概率
$res = $this->get_rand([$task->second_push_rate, 100 - $task->second_push_rate]);
if($res == 1){
$this->output('非广告投放日第一封询盘 概率' . (100 - $task->second_push_rate) . '%延迟推送');
//随机分配到未投放广告日期
$now = Carbon::now();
// 随机开始时间(本周四或现在)
$startTime = max($now->timestamp, $now->startOfWeek(4)->timestamp);
$random = mt_rand($startTime, $now->endOfWeek()->timestamp);
return $random - $now->timestamp;
$delay = $random - time();
$this->output('非广告投放日第一封询盘 概率' . (100 - $task->second_push_rate) . '%延迟推送' . $delay);
return $delay;
}
}
}
... ...
... ... @@ -249,13 +249,13 @@ class InquiryForwardLogic extends BaseLogic
$num = $this->param['num'] ?? 3;
$model = new InquiryProjectRoute();
if ($this->param['type'] == 1) {
//使用全文索引搜索
$routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$this->param['keywords']]);
} else {
// if ($this->param['type'] == 1) {
// //使用全文索引搜索
// $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$this->param['keywords']]);
// } else {
//使用like查询
$routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $this->param['keywords'] . '%');
}
// }
$re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray();
... ...
... ... @@ -450,6 +450,21 @@ class SyncSubmitTaskService
if(empty($data['referer']) || empty($data['user_agent']) || empty($data['data'])){
throw new InquiryFilterException( '数据异常:' . $data['country']);
}
//关杰 全局过滤 满足 name、message 8-16 纯字母不含空格 ip 荷兰 mobile 10位纯数字 过滤
if(
strlen($data['data']['name']) <= 16 && strlen($data['data']['name']) >= 8 &&
strlen($data['data']['message']) <= 16 && strlen($data['data']['message']) >= 8 &&
preg_match('/^[a-zA-Z]+$/', $data['data']['name']) &&
preg_match('/^[a-zA-Z]+$/', $data['data']['message']) &&
preg_match('/^\d+$/', $data['data']['phone']) &&
strlen($data['data']['phone']) == 10 &&
in_array($data['country'], ['荷兰', '俄罗斯'])
){
throw new InquiryFilterException( '全局过滤');
}
$config = InquiryFilterConfig::getCacheInfoByProjectId($project_id);
//没配置 则默认开启且使用全局
if(!$config){
... ...