作者 lyh

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

... ... @@ -8,6 +8,7 @@
namespace App\Console\Commands\Monitor;
use App\Models\Domain\DomainInfo;
use App\Models\PackDir\SitePackTask;
use App\Models\Product\Keyword;
use App\Models\Project\DeployOptimize;
use App\Models\Project\OnlineCheck;
... ... @@ -183,14 +184,14 @@ class Supervisory extends Command
$ids = Project::leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id')
->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id')
->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id')
->where('gl_project_deploy_optimize.domain','!=',0)
->where('b.domain','!=',0)
->where('gl_project.type', Project::TYPE_TWO)
->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制
->where('gl_project.delete_status', Project::IS_DEL_FALSE)
->where(function ($subQuery) {
$subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE);
})
->pluck('gl_project.id')
->pluck('gl_project.type','gl_project.id')
->toArray();
$project_ids = array_rand($ids, 10);
return $project_ids;
... ... @@ -296,6 +297,14 @@ class Supervisory extends Command
$message[] = '404页面链接: ' . implode(' 、 ', $page_404);
$message[] = 'TDK错误链接: ' . implode(' 、 ', $tdk_error);
//前一天页面生成失败白帽项目
$last_day = date('Y-m-d',strtotime('-1 day'));
$white_project_ids = SitePackTask::where('status',SitePackTask::STATUS_FAL)->where('user_id',0)->whereBetween('created_at', [$last_day.' 00:00:00',$last_day.' 23:59:59'])->pluck('project_id')->toArray();
if($white_project_ids){
$white_domain_list = DomainInfo::whereIn('project_id',$white_project_ids)->pluck('domain')->toArray();
$message[] = '页面生成失败白帽项目: ' . implode(' 、 ', $white_domain_list);
}
$msg = implode(PHP_EOL, $message);
$link = 'https://oapi.dingtalk.com/robot/send?access_token=3927b42d072972fcf572e7b01728bf3e1390e08094d6f77c5f28bfd85b19f09f';
... ...
... ... @@ -53,11 +53,14 @@ class SyncSubmitTask extends Command
}
try {
//有globalso-domain时,用globalso-domain,兼容白帽版的-海龙
if(!empty($task_info['data']['data']['globalso-domain'])){
$data = $task_info['data'];
$data['domain'] = $task_info['data']['data']['globalso-domain'];
$task_info['data'] = $data;
$data = $task_info['data']['data'];
if(!empty($data['globalso-domain']) || !empty($data['globalso-domain_host_url'])){
$task_data = $task_info['data'];
!empty($data['globalso-domain']) && $task_data['domain'] = $data['globalso-domain'];
!empty($data['globalso-domain_host_url']) && $task_data['referer'] = $data['globalso-domain_host_url'];
$task_info['data'] = $task_data;
}
$project = Project::getProjectByDomain($task_info['data']['domain'] ?? '');
if(!$project){
//是否有关联的域名
... ...
... ... @@ -10,6 +10,7 @@ use App\Models\Subscribe\Smtp;
use App\Models\Workchat\MessagePush;
use App\Services\Aside\ProjectAssociation\ProjectAssociationServices;
use Illuminate\Console\Command;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Mail;
... ... @@ -44,6 +45,10 @@ class WorkchatMessageSend extends Command
ProjectAssociationServices::getInstance()->sendMessage($task->friend_id, $task->content, $task->content_type);
$this->output('推送消息' . $task->id . '成功');
$task->status = MessagePush::STATUS_SUCCESS;
}catch (ConnectionException $e){
$this->output('推送消息' . $task->id . '超时');
$task->status = MessagePush::STATUS_ERROR;
$task->remark = '请求超时';
}catch (\Exception $e){
$this->output('推送消息' . $task->id . '失败:' . $e->getMessage());
$task->status = MessagePush::STATUS_ERROR;
... ...
... ... @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService
];
$param['sign'] = $this->getSign($param);
$url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg';
$result = Http::withoutVerifying()->post($url, $param)->json();
$result = Http::withoutVerifying()->timeout(30)->post($url, $param)->json();
if(empty($result) || $result['status'] != 200){
throw new \Exception($result['message'] ?? '');
}
... ...
... ... @@ -9,6 +9,7 @@ use App\Models\Domain\CountryCode;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryForm;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Inquiry\InquiryRelateDomain;
use App\Models\Project\AutoEmail;
use App\Models\Project\AutoEmailLog;
use App\Models\Project\InquiryFilterConfig;
... ... @@ -399,7 +400,15 @@ class SyncSubmitTaskService
public static function checkIpCountry($domain, $ip, $type){
$project = Project::getProjectByDomain($domain);
if(empty($project)){
throw new InquiryFilterException('项目不存在');
//是否有关联的域名
$relate_domain = InquiryRelateDomain::getRelateDomain($domain);
if(!$relate_domain){
throw new InquiryFilterException('项目不存在1');
}
$project = Project::getProjectByDomain($relate_domain);
if(!$project){
throw new InquiryFilterException('项目不存在2');
}
}
// 访问记录过滤测试环境
... ...