Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server
正在显示
5 个修改的文件
包含
34 行增加
和
8 行删除
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | namespace App\Console\Commands\Monitor; | 8 | namespace App\Console\Commands\Monitor; |
| 9 | 9 | ||
| 10 | use App\Models\Domain\DomainInfo; | 10 | use App\Models\Domain\DomainInfo; |
| 11 | +use App\Models\PackDir\SitePackTask; | ||
| 11 | use App\Models\Product\Keyword; | 12 | use App\Models\Product\Keyword; |
| 12 | use App\Models\Project\DeployOptimize; | 13 | use App\Models\Project\DeployOptimize; |
| 13 | use App\Models\Project\OnlineCheck; | 14 | use App\Models\Project\OnlineCheck; |
| @@ -183,14 +184,14 @@ class Supervisory extends Command | @@ -183,14 +184,14 @@ class Supervisory extends Command | ||
| 183 | $ids = Project::leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') | 184 | $ids = Project::leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') |
| 184 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') | 185 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') |
| 185 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') | 186 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') |
| 186 | - ->where('gl_project_deploy_optimize.domain','!=',0) | 187 | + ->where('b.domain','!=',0) |
| 187 | ->where('gl_project.type', Project::TYPE_TWO) | 188 | ->where('gl_project.type', Project::TYPE_TWO) |
| 188 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 | 189 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 |
| 189 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) | 190 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) |
| 190 | ->where(function ($subQuery) { | 191 | ->where(function ($subQuery) { |
| 191 | $subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); | 192 | $subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); |
| 192 | }) | 193 | }) |
| 193 | - ->pluck('gl_project.id') | 194 | + ->pluck('gl_project.type','gl_project.id') |
| 194 | ->toArray(); | 195 | ->toArray(); |
| 195 | $project_ids = array_rand($ids, 10); | 196 | $project_ids = array_rand($ids, 10); |
| 196 | return $project_ids; | 197 | return $project_ids; |
| @@ -296,6 +297,14 @@ class Supervisory extends Command | @@ -296,6 +297,14 @@ class Supervisory extends Command | ||
| 296 | $message[] = '404页面链接: ' . implode(' 、 ', $page_404); | 297 | $message[] = '404页面链接: ' . implode(' 、 ', $page_404); |
| 297 | $message[] = 'TDK错误链接: ' . implode(' 、 ', $tdk_error); | 298 | $message[] = 'TDK错误链接: ' . implode(' 、 ', $tdk_error); |
| 298 | 299 | ||
| 300 | + //前一天页面生成失败白帽项目 | ||
| 301 | + $last_day = date('Y-m-d',strtotime('-1 day')); | ||
| 302 | + $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(); | ||
| 303 | + if($white_project_ids){ | ||
| 304 | + $white_domain_list = DomainInfo::whereIn('project_id',$white_project_ids)->pluck('domain')->toArray(); | ||
| 305 | + $message[] = '页面生成失败白帽项目: ' . implode(' 、 ', $white_domain_list); | ||
| 306 | + } | ||
| 307 | + | ||
| 299 | $msg = implode(PHP_EOL, $message); | 308 | $msg = implode(PHP_EOL, $message); |
| 300 | 309 | ||
| 301 | $link = 'https://oapi.dingtalk.com/robot/send?access_token=3927b42d072972fcf572e7b01728bf3e1390e08094d6f77c5f28bfd85b19f09f'; | 310 | $link = 'https://oapi.dingtalk.com/robot/send?access_token=3927b42d072972fcf572e7b01728bf3e1390e08094d6f77c5f28bfd85b19f09f'; |
| @@ -53,11 +53,14 @@ class SyncSubmitTask extends Command | @@ -53,11 +53,14 @@ class SyncSubmitTask extends Command | ||
| 53 | } | 53 | } |
| 54 | try { | 54 | try { |
| 55 | //有globalso-domain时,用globalso-domain,兼容白帽版的-海龙 | 55 | //有globalso-domain时,用globalso-domain,兼容白帽版的-海龙 |
| 56 | - if(!empty($task_info['data']['data']['globalso-domain'])){ | ||
| 57 | - $data = $task_info['data']; | ||
| 58 | - $data['domain'] = $task_info['data']['data']['globalso-domain']; | ||
| 59 | - $task_info['data'] = $data; | 56 | + $data = $task_info['data']['data']; |
| 57 | + if(!empty($data['globalso-domain']) || !empty($data['globalso-domain_host_url'])){ | ||
| 58 | + $task_data = $task_info['data']; | ||
| 59 | + !empty($data['globalso-domain']) && $task_data['domain'] = $data['globalso-domain']; | ||
| 60 | + !empty($data['globalso-domain_host_url']) && $task_data['referer'] = $data['globalso-domain_host_url']; | ||
| 61 | + $task_info['data'] = $task_data; | ||
| 60 | } | 62 | } |
| 63 | + | ||
| 61 | $project = Project::getProjectByDomain($task_info['data']['domain'] ?? ''); | 64 | $project = Project::getProjectByDomain($task_info['data']['domain'] ?? ''); |
| 62 | if(!$project){ | 65 | if(!$project){ |
| 63 | //是否有关联的域名 | 66 | //是否有关联的域名 |
| @@ -10,6 +10,7 @@ use App\Models\Subscribe\Smtp; | @@ -10,6 +10,7 @@ use App\Models\Subscribe\Smtp; | ||
| 10 | use App\Models\Workchat\MessagePush; | 10 | use App\Models\Workchat\MessagePush; |
| 11 | use App\Services\Aside\ProjectAssociation\ProjectAssociationServices; | 11 | use App\Services\Aside\ProjectAssociation\ProjectAssociationServices; |
| 12 | use Illuminate\Console\Command; | 12 | use Illuminate\Console\Command; |
| 13 | +use Illuminate\Http\Client\ConnectionException; | ||
| 13 | use Illuminate\Support\Facades\Config; | 14 | use Illuminate\Support\Facades\Config; |
| 14 | use Illuminate\Support\Facades\Mail; | 15 | use Illuminate\Support\Facades\Mail; |
| 15 | 16 | ||
| @@ -44,6 +45,10 @@ class WorkchatMessageSend extends Command | @@ -44,6 +45,10 @@ class WorkchatMessageSend extends Command | ||
| 44 | ProjectAssociationServices::getInstance()->sendMessage($task->friend_id, $task->content, $task->content_type); | 45 | ProjectAssociationServices::getInstance()->sendMessage($task->friend_id, $task->content, $task->content_type); |
| 45 | $this->output('推送消息' . $task->id . '成功'); | 46 | $this->output('推送消息' . $task->id . '成功'); |
| 46 | $task->status = MessagePush::STATUS_SUCCESS; | 47 | $task->status = MessagePush::STATUS_SUCCESS; |
| 48 | + }catch (ConnectionException $e){ | ||
| 49 | + $this->output('推送消息' . $task->id . '超时'); | ||
| 50 | + $task->status = MessagePush::STATUS_ERROR; | ||
| 51 | + $task->remark = '请求超时'; | ||
| 47 | }catch (\Exception $e){ | 52 | }catch (\Exception $e){ |
| 48 | $this->output('推送消息' . $task->id . '失败:' . $e->getMessage()); | 53 | $this->output('推送消息' . $task->id . '失败:' . $e->getMessage()); |
| 49 | $task->status = MessagePush::STATUS_ERROR; | 54 | $task->status = MessagePush::STATUS_ERROR; |
| @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService | @@ -189,7 +189,7 @@ class ProjectAssociationServices extends BaseService | ||
| 189 | ]; | 189 | ]; |
| 190 | $param['sign'] = $this->getSign($param); | 190 | $param['sign'] = $this->getSign($param); |
| 191 | $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; | 191 | $url = 'https://hub.ai.cc/api/globalso_ai_customer_service/send_msg'; |
| 192 | - $result = Http::withoutVerifying()->post($url, $param)->json(); | 192 | + $result = Http::withoutVerifying()->timeout(30)->post($url, $param)->json(); |
| 193 | if(empty($result) || $result['status'] != 200){ | 193 | if(empty($result) || $result['status'] != 200){ |
| 194 | throw new \Exception($result['message'] ?? ''); | 194 | throw new \Exception($result['message'] ?? ''); |
| 195 | } | 195 | } |
| @@ -9,6 +9,7 @@ use App\Models\Domain\CountryCode; | @@ -9,6 +9,7 @@ use App\Models\Domain\CountryCode; | ||
| 9 | use App\Models\Domain\DomainInfo; | 9 | use App\Models\Domain\DomainInfo; |
| 10 | use App\Models\Inquiry\InquiryForm; | 10 | use App\Models\Inquiry\InquiryForm; |
| 11 | use App\Models\Inquiry\InquiryFormData; | 11 | use App\Models\Inquiry\InquiryFormData; |
| 12 | +use App\Models\Inquiry\InquiryRelateDomain; | ||
| 12 | use App\Models\Project\AutoEmail; | 13 | use App\Models\Project\AutoEmail; |
| 13 | use App\Models\Project\AutoEmailLog; | 14 | use App\Models\Project\AutoEmailLog; |
| 14 | use App\Models\Project\InquiryFilterConfig; | 15 | use App\Models\Project\InquiryFilterConfig; |
| @@ -399,7 +400,15 @@ class SyncSubmitTaskService | @@ -399,7 +400,15 @@ class SyncSubmitTaskService | ||
| 399 | public static function checkIpCountry($domain, $ip, $type){ | 400 | public static function checkIpCountry($domain, $ip, $type){ |
| 400 | $project = Project::getProjectByDomain($domain); | 401 | $project = Project::getProjectByDomain($domain); |
| 401 | if(empty($project)){ | 402 | if(empty($project)){ |
| 402 | - throw new InquiryFilterException('项目不存在'); | 403 | + //是否有关联的域名 |
| 404 | + $relate_domain = InquiryRelateDomain::getRelateDomain($domain); | ||
| 405 | + if(!$relate_domain){ | ||
| 406 | + throw new InquiryFilterException('项目不存在1'); | ||
| 407 | + } | ||
| 408 | + $project = Project::getProjectByDomain($relate_domain); | ||
| 409 | + if(!$project){ | ||
| 410 | + throw new InquiryFilterException('项目不存在2'); | ||
| 411 | + } | ||
| 403 | } | 412 | } |
| 404 | 413 | ||
| 405 | // 访问记录过滤测试环境 | 414 | // 访问记录过滤测试环境 |
-
请 注册 或 登录 后发表评论