作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

<?php
/**
* @remark :
* @name :ImportCustomModule.php
* @author :lyh
* @method :post
* @time :2024/12/9 11:35
*/
namespace App\Console\Commands\CustomModule;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\CustomModule\CustomModuleExtentContent;
use App\Models\RouteMap\RouteMap;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class ImportCustomModule extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'import_custom_module';
/**
* The console command description.
*
* @var string
*/
protected $description = 'import_custom_module';
/**
* @remark :导入
* @name :handle
* @author :lyh
* @method :post
* @time :2024/12/9 11:36
*/
public function handle(){
echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
ProjectServer::useProject(2837);
$this->import_module_content();
DB::disconnect('custom_mysql');
}
/**
* @remark :导入扩展模块 (保留)
* @name :ceshis
* @author :lyh
* @method :post
* @time :2024/12/6 17:02
*/
public function import_module_content(){
$data = 'MBR10100CT,Rectifier/Schottky Barrier Rectifier,TO-220AB,100,5*2,common cathode,100,0.85,10,2500,175,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR10100CT.pdf
MBR2060BCT,Rectifier/Schottky Barrier Rectifier,ITO-220AB,60,10*2,common cathode,150,0.75,50,5000,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR2060BCT.pdf
MBR20150DCT,Rectifier/Schottky Barrier Rectifier,TO-263(D2PAK),150,10*2,common cathode,150,0.88,5,1500,175,-,Active,https://v6-file.globalso.com/upload/p/2837/files/MBR20150DCT.pdf
MUR2060CT,Rectifier/High Efficient Rectifier,TO-220AB,600,10*2,common cathode,150,1.7,1,500,150,50,Active,https://v6-file.globalso.com/upload/p/2837/files/MUR2060CT.pdf
MUR2040FCT,Rectifier/High Efficient Rectifier,ITO-220AB,400,10*2,common cathode,150,1.3,1,500,150,50,Active,https://v6-file.globalso.com/upload/p/2837/files/MUR2040FCT.pdf
DSEK20S04B,Rectifier/Ultra fast soft Recovery Rectifier,TO-252(DPAK),400,10*2,common cathode,125,1.25,2,500,175,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK20S04B.pdf
DSEK30S06D,Rectifier/Ultra fast soft Recovery Rectifier,TO-263(D2PAK),600,15*2,common cathode,150,1.7,2,500,175,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK30S06D.pdf
DSEK60H06P,Rectifier/Ultra fast soft Recovery Rectifier,TO-247AD,600,30*2,common cathode,300,1.7,5,500,175,60,Active,https://v6-file.globalso.com/upload/p/2837/files/DSEK60H06P.pdf
GBU410,Rectifier/Bridge Rectifier,GBU,1000,4,-,125,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU410.pdf
GBU1510,Rectifier/Bridge Rectifier,GBU,1000,15,-,250,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1510.pdf
GBJ2510,Rectifier/Bridge Rectifier,GBJ,1000,25,-,300,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2510.pdf
GBU1504H,Rectifier/High Efficient Bridge Rectifier,GBU,400,15,-,150,1.3,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1504H.pdf
GBU1506H,Rectifier/High Efficient Bridge Rectifier,GBU,400,15,-,150,1.7,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBU1506H.pdf
GBJ2504H,Rectifier/High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.3,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2504H.pdf
GBJ2506H,Rectifier/High Efficient Bridge Rectifier,GBJ,600,25,-,250,1.7,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/GBJ2506H.pdf
1N4007,Rectifier/Standard Recovery Rectifier,DO-41,1000,1,-,50,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N4007.pdf
1N5399,Rectifier/Standard Recovery Rectifier,DO-15,1000,1.5,-,75,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N5399.pdf
1N5408,Rectifier/Standard Recovery Rectifier,DO-27,1000,3,-,100,1,1,500,150,-,Active,https://v6-file.globalso.com/upload/p/2837/files/1N5408.pdf
RS1M,Rectifier/Fast Recovery Rectifier,SMA,1000,1,-,50,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS1M.pdf
RS2M,Rectifier/Fast Recovery Rectifier,SMB,1000,2,-,75,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS2M.pdf
RS3M,Rectifier/Fast Recovery Rectifier,SMC,1000,3,-,100,1.3,1,500,150,500,Active,https://v6-file.globalso.com/upload/p/2837/files/RS3M.pdf
SF28,Rectifier/Super fast Recovery Rectifier,DO-15,600,2,-,60,1.7,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/SF28.pdf
SF56G,Rectifier/Super fast Recovery Rectifier,DO-27,400,5,-,125,1.3,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/SF56G.pdf
DSE1006,Rectifier/Super fast Recovery Rectifier,TO-220AC,600,10,Single Positive,150,1.7,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSE1006.pdf
DSE1504F,Rectifier/Super fast Recovery Rectifier,ITO-220AC,400,15,Single Positive,150,1.4,1,500,150,35,Active,https://v6-file.globalso.com/upload/p/2837/files/DSE1504F.pdf';
$array = explode("\n", $data);
foreach ($array as $values){
$array1 = explode(',',$values);
$contentData = [
'name'=>$array1[0],
'route'=>'',
'project_id'=>2837,
'operator_id'=>6393,
'module_id'=>2,
];
$customModuleCategoryModel = new CustomModuleCategory();
if(!empty($array1[1])){
$cate_ids = '';
$cate_arr = explode('/',$array1[1]);
echo date('Y-m-d H:i:s') . 'json_fenle:' . json_encode($cate_arr) . PHP_EOL;
foreach ($cate_arr as $cateV){
$catInfo = $customModuleCategoryModel->read(['name'=>$cateV]);
if($catInfo !== false){
$cate_ids = $cate_ids.','.$catInfo['id'];
}
}
echo date('Y-m-d H:i:s') . '处理后的fenle:' . $cate_ids . PHP_EOL;
$contentData['category_id'] = empty($cate_ids) ? '' : $cate_ids.',';
}else{
$catInfo = $customModuleCategoryModel->read(['name'=>$array1[1]]);
if($catInfo !== false){
$contentData['category_id'] = ','.$catInfo['id'].',';
}
}
$customModuleContentModel = new CustomModuleContent();
$contentId = $customModuleContentModel->addReturnId($contentData);
$route = RouteMap::setRoute($array1[0],RouteMap::SOURCE_MODULE,$contentId,2837);
$customModuleContentModel->edit(['route'=>$route],['id'=>$contentId]);
$pd_extended_field_arr = [
[
'key'=>'pd_extended_field_1',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[2],
'content_id'=>$contentId,
'module_id'=>2,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_2',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[3],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_3',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[4],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_4',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[5],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_5',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[6],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_6',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[7],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_7',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[8],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_8',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[9],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_9',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[10],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_10',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[11],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_11',
'type'=>1,
'project_id'=>2837,
'values'=>$array1[12],
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
[
'key'=>'pd_extended_field_12',
'type'=>4,
'project_id'=>2837,
'values'=>json_encode([['url'=>$array1[13]]]),
'module_id'=>2,
'content_id'=>$contentId,
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s'),
],
];
$extendContentModel = new CustomModuleExtentContent();
$extendContentModel->insert($pd_extended_field_arr);
}
}
}
... ...
... ... @@ -36,6 +36,7 @@ class RemainDay extends Command
*/
protected $ceaseProjectId = [
354,
378,
649,
1283,
2066
... ...
... ... @@ -204,7 +204,7 @@ class RelayInquiry extends Command
}
// 未设置对法对象
$target_num_arr = array_map(function ($item) {
return count($item['target']);
return count($item['target']) + count($item['shop_site']) + count($item['fob_pro']);
}, $ad_task);
if (!array_sum($target_num_arr)) {
$val->status = ReInquiryForm::STATUS_FORGO;
... ... @@ -225,6 +225,8 @@ class RelayInquiry extends Command
$res = false;
foreach ($ad_task as $task){
$res += $this->relayDetail($task, $val);
$res += $this->relayShopDetail($task, $val);
$res += $this->relayFobDetail($task, $val);
}
$val->status = $res ? ReInquiryForm::STATUS_SUCCESS : ReInquiryForm::STATUS_FORGO;
$val->save();
... ... @@ -288,7 +290,10 @@ class RelayInquiry extends Command
public function relayDetail($task, $form)
{
$this->output('获取转发对象');
if(empty($task['target'] )){
$this->output('没有独立站转发对象');
return 0;
}
//是否有必选的
$require_data = [];
foreach ($task['target'] as $item){
... ... @@ -327,65 +332,136 @@ class RelayInquiry extends Command
$is_v6 = $item['is_v6'];
$re_website = 'https://' . $domain . '/';
$this->output('转发对象:' . $domain);
$this->output('获取转发链接');
// v6:有邮箱推送主站,没有邮箱推送AMP站;v5:仅推送有邮箱到主站
$lang = '';
if ($is_v6) {
// 获取语种, 6.0是可以确定语种的
$project = Project::getProjectByDomain($domain);
if (empty($project)) {
$this->logChannel()->info('广告任务ID:' . $task['id'] . ', 转发对象:' . $re_website . '非v6链接,转发失败;', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]);
//urls
list($urls, $lang) = $this->getUrls($is_v6, $domain, $re_website, $form, $task);
if(!$urls){
continue;
}
$lang = WebLanguage::getLangById($project->main_lang_id ?? 1)['short'];
// 获取访问明细和着陆页
$product_url = $this->getLinksFromSitemap($re_website . 'product_sitemap.xml');
$product_cate_url = $this->getLinksFromSitemap($re_website . 'product_category_sitemap.xml');
$keywords_url = $this->getLinksFromSitemap($re_website . 'product_keywords_sitemap.xml');
$page_url = $this->getLinksFromSitemap($re_website . 'page_sitemap.xml');
} else {
if($form->email){
//通过sitemap拿访问页面
$product_url = $this->getLinksFromSitemap($re_website . 'sitemap_post.xml');
$product_cate_url = $this->getLinksFromSitemap($re_website . 'sitemap_category.xml');
$keywords_url = $this->getLinksFromSitemap($re_website . 'sitemap_post_tag.xml');
$page_url = $this->getLinksFromSitemap($re_website . 'sitemap_page.xml');
}else{
//m站先就往contact-us着陆
$product_url = $product_cate_url = $keywords_url = [];
$page_url = [$re_website . 'contact-us/'];
//ip
$ip_data = $this->getIpData($form->country_name);
$ip = $ip_data->ip;
$country_name = $ip_data->ip_area;
//message
list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain);
$lang = $lang ?: $msg_lang;
$this->output('获取转发设备信息');
// 客户端 头信息 来源
$device_port = $form->email ? '1' : '2'; //1 pc 2移动端
$user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua);
$referrer = $this->getReferer($country_name, $lang);
$this->output('写入数据');
$pre = 0;
$start_time = time();
$seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
if($exists){
$this->output('转发站点邮件已存在');
continue;
}
// 写入推送详情
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port,
$user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds));
foreach ($urls as $k=>$v){
$pre++;
$seconds += rand(3,10);
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_VISIT, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
// 最后一次访问询盘 加上询盘
if($k+1 >= count($urls)){
$seconds += rand(10,30);
$pre++;
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
}
}
}
return true;
}
// 所有可用url
$urls = $inquiry_urls = [];
//入口url 首页30%,单页10%,聚合页60%
$type = getRandByRatio([30,10,60]);
$inlet = $re_website;
$type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website;
$type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website;
$urls[] = $inquiry_urls[] = $inlet;
$all_urls = array_merge($urls, $product_url, $product_cate_url, $keywords_url, $page_url);
$inquiry_urls = array_merge($urls, $product_cate_url, $keywords_url, $page_url);
public function relayShopDetail($task, $form)
{
$this->output('获取商城转发对象');
// 随机访问1-6个页面
$deep = rand(1,6);
if($deep > 2) {
$visit_urls = Arr::random($all_urls, rand(1, count($all_urls) > 4 ? 4 : count($all_urls)));
$urls = array_merge($urls, $visit_urls);
if(empty($task['shop_site'])){
$this->output('没有商城转发对象');
return 0;
}
if($deep > 1) {
// 推送着落页只能是 首页、产品分类、单页面、聚合页
if (!in_array(end($urls), $inquiry_urls)) {
$urls[] = Arr::random($inquiry_urls);
foreach ($task['shop_site'] as $item) {
//手机号过滤
$phone = $form->phone;
// 推送站点
$domain = $item;
$re_website = 'https://' . $domain . '/';
$paths = ['', 'contact-us'];
$url = $re_website . $paths[array_rand($paths)];
//ip
$ip_data = $this->getIpData($form->country_name);
$ip = $ip_data->ip;
$country_name = $ip_data->ip_area;
//message
list($message, $message_id, $lang) = $this->getMessage($task, $form->message, $domain);
$device_port = $form->email ? '1' : '2'; //1 pc 2移动端
$user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua);
$referrer = $this->getReferer($country_name, $lang);
$start_time = time();
$seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
if($exists){
$this->output('转发站点邮件已存在');
continue;
}
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id,
$device_port, $user_agent, $referrer, [$url], 0, date('Y-m-d H:i:s', $start_time + $seconds), ReInquiryDetail::STATUS_INIT, 2);
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, 1, $url, date('Y-m-d H:i:s', $start_time + $seconds));
}
return true;
}
public function relayFobDetail($task, $form)
{
$this->output('获取FOB转发对象');
if(empty($task['fob_pro'])){
$this->output('没有FOB转发对象');
return 0;
}
foreach ($task['fob_pro'] as $item) {
//手机号过滤
$phone = $form->phone;
// 推送站点
$postid = $item;
//message
list($message, $message_id, $lang) = $this->getMessage($task, $form->message, $postid);
$device_port = $form->email ? '1' : '2'; //1 pc 2移动端
$user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua);
$start_time = time();
$seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始
$exists = ReInquiryDetail::where('re_website', $postid)->where('email', $form->email)->first();
if($exists){
$this->output('转发站点邮件已存在');
continue;
}
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $postid, $country_name??'', $ip??'', $form->full_name, $form->email, $phone,
$message, $message_id, $device_port, $user_agent, $referrer??'', [$postid], 0, date('Y-m-d H:i:s', $start_time + $seconds), ReInquiryDetail::STATUS_INIT, 3);
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, 1, $postid, date('Y-m-d H:i:s', $start_time + $seconds));
}
return true;
}
public function getIpData($country_name){
$this->output('获取转发ip');
// TODO 获取IP:如果是简码,查询数据库获取对应的国家, 如果是国家使用翻译, 再转化成IP
$country = $form->country_name;
$country = $country_name;
// 有国家 通过国家查询, 如果没有获取到就随机获取
$where = [];
$country && $where['ip_area'] = $country;
... ... @@ -393,11 +469,12 @@ class RelayInquiry extends Command
if (empty($ip_data)) {
$ip_data = DB::table('gl_xunpan_ipdata')->inRandomOrder()->first();
}
$ip = $ip_data->ip;
$country_name = $ip_data->ip_area;
return $ip_data;
}
public function getMessage($task, $message, $domain){
$this->output('转发内容');
$message = $form->message;
$form_message = $message;
$message_id = 0;
//开启文案替换
if ($task['is_replace_text'] == 2) {
... ... @@ -419,7 +496,6 @@ class RelayInquiry extends Command
}
if ($task['is_replace_text'] == 1 || strlen($message) <= 4) {
//配置文案库替换或者字符少于4个,直接替换文案
$use_ids = ReInquiryDetail::where(['re_website' => $domain])->where('status', '<>', ReInquiryDetail::STATUS_FAIL)->pluck('text_id')->toArray();
$text = ReInquiryText::whereNotIn('id', $use_ids)->where('status', ReInquiryText::STATUS_USABLE)->inRandomOrder()->first();
$message = $text->content;
... ... @@ -429,10 +505,10 @@ class RelayInquiry extends Command
$text->save();
//原内容非英语,转为对应语种
if (is_numeric($form->message)) { //数字会被识别为中文
if (is_numeric($form_message)) { //数字会被识别为中文
$lang = 'en';
} else {
$translateSl = Translate::translateSl($form->message);
$translateSl = Translate::translateSl($form_message);
$lang = $translateSl['texts']['sl'] ?? 'en';
}
... ... @@ -440,40 +516,67 @@ class RelayInquiry extends Command
$message = Translate::tran($message, $lang);
}
}
return [$message, $message_id, $lang??''];
}
$this->output('获取转发设备信息');
// 客户端 头信息 来源
$device_port = $form->email ? '1' : '2'; //1 pc 2移动端
$user_agent = $form->email ? Arr::random($this->pc_ua) : Arr::random($this->mobile_ua);
$referrer = $this->getReferer($country_name, $lang);
$this->output('写入数据');
public function getUrls($is_v6, $domain, $re_website, $form, $task){
$this->output('转发对象:' . $domain);
$this->output('获取转发链接');
// v6:有邮箱推送主站,没有邮箱推送AMP站;v5:仅推送有邮箱到主站
$lang = '';
if ($is_v6) {
// 获取语种, 6.0是可以确定语种的
$project = Project::getProjectByDomain($domain);
if (empty($project)) {
$this->logChannel()->info('广告任务ID:' . $task['id'] . ', 转发对象:' . $re_website . '非v6链接,转发失败;', ['广告任务ID:' . $task['id'], '询盘ID:' . $form->id]);
return [[], $lang];
}
$lang = WebLanguage::getLangById($project->main_lang_id ?? 1)['short'];
$pre = 0;
$start_time = time();
$seconds = rand(300, 3000); // 开始时间 从5-50分钟后开始
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
if($exists){
$this->output('转发站点邮件已存在');
continue;
// 获取访问明细和着陆页
$product_url = $this->getLinksFromSitemap($re_website . 'product_sitemap.xml');
$product_cate_url = $this->getLinksFromSitemap($re_website . 'product_category_sitemap.xml');
$keywords_url = $this->getLinksFromSitemap($re_website . 'product_keywords_sitemap.xml');
$page_url = $this->getLinksFromSitemap($re_website . 'page_sitemap.xml');
} else {
if($form->email){
//通过sitemap拿访问页面
$product_url = $this->getLinksFromSitemap($re_website . 'sitemap_post.xml');
$product_cate_url = $this->getLinksFromSitemap($re_website . 'sitemap_category.xml');
$keywords_url = $this->getLinksFromSitemap($re_website . 'sitemap_post_tag.xml');
$page_url = $this->getLinksFromSitemap($re_website . 'sitemap_page.xml');
}else{
//m站先就往contact-us着陆
$product_url = $product_cate_url = $keywords_url = [];
$page_url = [$re_website . 'contact-us/'];
}
// 写入推送详情
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port,
$user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds));
foreach ($urls as $k=>$v){
$pre++;
$seconds += rand(3,10);
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_VISIT, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
// 最后一次访问询盘 加上询盘
if($k+1 >= count($urls)){
$seconds += rand(10,30);
$pre++;
ReInquiryDetailLog::createInquiryLog($re_detail->id, ReInquiryDetailLog::TYPE_INQUIRY, $pre, $v, date('Y-m-d H:i:s', $start_time + $seconds));
}
// 所有可用url
$urls = $inquiry_urls = [];
//入口url 首页30%,单页10%,聚合页60%
$type = getRandByRatio([30,10,60]);
$inlet = $re_website;
$type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website;
$type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website;
$urls[] = $inquiry_urls[] = $inlet;
$all_urls = array_merge($urls, $product_url, $product_cate_url, $keywords_url, $page_url);
$inquiry_urls = array_merge($urls, $product_cate_url, $keywords_url, $page_url);
// 随机访问1-6个页面
$deep = rand(1,6);
if($deep > 2) {
$visit_urls = Arr::random($all_urls, rand(1, count($all_urls) > 4 ? 4 : count($all_urls)));
$urls = array_merge($urls, $visit_urls);
}
if($deep > 1) {
// 推送着落页只能是 首页、产品分类、单页面、聚合页
if (!in_array(end($urls), $inquiry_urls)) {
$urls[] = Arr::random($inquiry_urls);
}
}
return true;
return [$urls, $lang];
}
/**
* 获取待处理询盘表单
* @param int $num
... ... @@ -494,7 +597,7 @@ class RelayInquiry extends Command
{
$cache_key = 'inquiry_ads_tasks';
$ads = Cache::get($cache_key, function () use ($cache_key) {
$ads = ReInquiryTask::where(['status' => ReInquiryTask::STATUS_OPEN])->get(['id', 'ad_id', 'num', 'target', 'is_replace_text', 'ai_param']);
$ads = ReInquiryTask::where(['status' => ReInquiryTask::STATUS_OPEN])->get(['id', 'ad_id', 'num', 'target', 'is_replace_text', 'ai_param', 'shop_site', 'fob_pro']);
$array = [];
foreach ($ads as $key=>$val) {
$ad_ids = explode(',', $val['ad_id']);
... ...
... ... @@ -158,9 +158,37 @@ class postInquiry extends Command
}
public function inquiry(ReInquiryDetail $detail, ReInquiryDetailLog $log){
$website = 'https://' . $detail['re_website'] . '/';
$res = false;
if ($detail['type'] == 1) {
// v6
if($detail['is_v6']) {
if ($detail['is_v6']) {
$res = $this->v6Inquiry($detail, $log);
} else {
$res = $this->v5Inquiry($detail, $log);
}
} elseif ($detail['type'] == 2) {
//商城询盘
$res = $this->ShopInquiry($detail, $log);
} elseif ($detail['type'] == 3) {
//Fob询盘
$res = $this->FobInquiry($detail, $log);
}
if(!$res){
return false;
}
$log->status = ReInquiryDetailLog::STATUS_SUCCESS;
$log->save();
//统计
ReInquiryCount::addInquiryNum($detail['id'], $detail['re_website']);
return true;
}
public function v6Inquiry($detail, $log){
$website = 'https://' . $detail['re_website'] . '/';
$data = [
'name' => $detail['name'],
'phone' => $detail['phone'],
... ... @@ -168,22 +196,23 @@ class postInquiry extends Command
'submit_ip' => $detail['ip'],
'refer' => $log->url,
];
if($detail->email){
if ($detail->email) {
$data['email'] = $detail->email;
}else{
} else {
$data['__amp_source_origin'] = trim($website, '/');
}
$res = Http::withoutVerifying()->withHeaders(['User-Agent' => $detail['user_agent']])->post($website . 'api/inquiryQd/', $data)->json();
if(empty($res['code']) || $res['code'] != 200){
if (empty($res['code']) || $res['code'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
$log->save();
Log::channel('inquiry_relay')->error('inquiry_relay v6 inquiry error', [$res, $website . 'api/inquiryQd/', $data]);
return false;
}
}else{
return true;
}
public function v5Inquiry($detail, $log){
$data = [
'name' => $detail['name'],
'phone' => $detail['phone'],
... ... @@ -199,11 +228,11 @@ class postInquiry extends Command
$result = Http::withoutVerifying()->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data);
$res = $result->json();
//兼容接口返回格式
if(!empty($res['data'][0]['status'])){
if (!empty($res['data'][0]['status'])) {
$res['data'][0]['code'] = $res['data'][0]['status'] == 'success' ? 200 : 400;
!empty($res['data'][0]['msg']) && $res['message'] = $res['data'][0]['msg'];
}
if(empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200,300])){
if (empty($res['data'][0]['code']) || !in_array($res['data'][0]['code'], [200, 300])) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
$log->save();
... ... @@ -211,16 +240,49 @@ class postInquiry extends Command
Log::channel('inquiry_relay')->error('inquiry_relay v4|v5 inquiry error', [$result->body(), 'https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data]);
return false;
}
return true;
}
$log->status = ReInquiryDetailLog::STATUS_SUCCESS;
$log->save();
//统计
ReInquiryCount::addInquiryNum($detail['id'], $detail['re_website']);
public function ShopInquiry($detail, $log){
$data = [
'name' => $detail['name'],
'email' => $detail['email'],
'phone' => $detail['phone'],
'message' => $detail['message'],
'submit_ip' => $detail['ip'],
'refer' => $log['url'],
];
ksort($data);
$data['token'] = md5( json_encode($data, JSON_UNESCAPED_UNICODE ) . date("Y-m-d"));
$url = 'https://' . $detail['re_website'] . '/index.php?route=api/ai_inquiry/add';
$res = Http::withoutVerifying()->post($url, $data)->json();
if (empty($res['code']) || $res['code'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
$log->save();
return true;
Log::channel('inquiry_relay')->error('inquiry_relay shop inquiry error', [$res, $url, $data]);
return false;
}
}
public function FobInquiry($detail, $log){
$data = [
'name' => $detail['name'],
'email' => $detail['email'],
'phone' => $detail['phone'],
'post_id' => $log['url'],
];
$res = Http::withoutVerifying()->post('https://fob.ai.cc/api/ad_to_scrm', $data)->json();
if (empty($res['code']) || $res['code'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
$log->save();
Log::channel('inquiry_relay')->error('inquiry_relay fob inquiry error', [$res, 'https://fob.ai.cc/api/ad_to_scrm', $data]);
return false;
}
}
public function output($message)
{
... ...
... ... @@ -88,9 +88,9 @@ class SyncProject extends Command
if($data['data']['order_type'] == '首次'){
$this->sync($data['data'],$is_update);
//同步aicc
if($data['data']['exclusive_aicc']){
$this->toAicc($data['data']);
}
// if($data['data']['exclusive_aicc']){
// $this->toAicc($data['data']);
// }
//同步hagro
if($data['data']['exclusive_hagro']){
$this->toHagro($data['data']);
... ...
... ... @@ -16,9 +16,11 @@ use App\Models\Com\KeywordVideoTask;
use App\Models\Com\KeywordVideoTaskLog;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\CustomModule\CustomModuleExtentContent;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\Servers;
use App\Models\Devops\ServersIp;
use App\Models\ExtentModule\ExtensionModuleValue;
use App\Models\File\File;
use App\Models\File\File as FileModel;
use App\Models\File\Image;
... ... @@ -62,14 +64,12 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
$keywordVideoModel = new KeywordVideoTask();
$list = $keywordVideoModel->list();
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['project_id'] . PHP_EOL;
ProjectServer::useProject($v['project_id']);
$this->getProduct();
echo date('Y-m-d H:i:s') . 'project_id:' . PHP_EOL;
ProjectServer::useProject(2837);
$this->ceshi();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ...
... ... @@ -57,7 +57,7 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>['=',1423]]);
$list = $projectModel->list(['id'=>['=',827]]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ...
... ... @@ -61,7 +61,7 @@ class FormGlobalsoApi
'domain' => $domain,
'limit' => $page_size,
'page' => $page,
'source' => $is_upgrade ? '1,2,3,4' : '1,3' //来源类型 新项目用1,3
'source' => $is_upgrade ? '1,2,3,4,5' : '1,3,5' //来源类型 新项目用1,3
];
if($ids){
$params['ids'] = implode(',', $ids);
... ... @@ -175,7 +175,7 @@ class FormGlobalsoApi
$data = [
'domain' => $domain,
'token' => $token,
'source'=> $is_upgrade ? '1,2,3,4' : '1,3',
'source'=> $is_upgrade ? '1,2,3,4,5' : '1,3,5',
'num'=>15,
];
$queryString = http_build_query($data);
... ... @@ -202,7 +202,7 @@ class FormGlobalsoApi
$data = [
'domain' => $url,
'token' => $token,
'source'=> $is_upgrade ? '1,2,3,4' : '1,3',
'source'=> $is_upgrade ? '1,2,3,4,5' : '1,3,5',
'model' => 'month',
'sta_date'=>$month,
];
... ...
... ... @@ -23,6 +23,7 @@ use App\Utils\HttpUtils;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
/**
* Class AdsController
... ... @@ -126,7 +127,9 @@ class AdsController extends BaseController
public function setRelaySite(Request $request)
{
$id = intval($request->input('id', 0));
$target = $request->input('target');
$target = $request->input('target', []);
$shop_site = $request->input('shop_site', []);
$fob_pro = $request->input('fob_pro', []);
$task = ReInquiryTask::find($id);
if(!$task){
return $this->response('广告不存在!', Code::USER_ERROR, []);
... ... @@ -153,15 +156,42 @@ class AdsController extends BaseController
if($is_require_num > $task->num){
return $this->response('必选渠道不能大于转发数量!', Code::USER_ERROR, []);
}
foreach ($target as $v){
ReInquiryCount::addInquiryNum($id, $v['url'], 0);
}
//商城
foreach ($shop_site as &$url) {
if (empty($url)) {
return $this->response('商城网站域名不能为空!', Code::USER_ERROR, []);
}
$url = trim(str_replace(['http://', 'https://'], '', $url), '/');
$res = Http::get($url . '/index.php?route=api/ai_inquiry/add')->json();
if (!$res) {
return $this->response($url . '不是商城网站!', Code::USER_ERROR, []);
}
ReInquiryCount::addInquiryNum($id, $url, 0, 2);
}
//超级项目
foreach ($fob_pro as &$postid) {
if (empty($postid)) {
return $this->response('项目ID不能为空!', Code::USER_ERROR, []);
}
ReInquiryCount::addInquiryNum($id, $postid, 0, 3);
}
$task->target = json_encode($target);
$task->shop_site = json_encode($shop_site);
$task->fob_pro = json_encode($fob_pro);
$task->save();
return $this->response('success', Code::SUCCESS, []);
}
public function fob_projects(){
$res = ReInquiryCount::getFobProjects();
return $this->response('success', Code::SUCCESS, $res);
}
/**
* 验证站点5.0还是6.0, 代理商信息
* @param Request $request
... ...
... ... @@ -12,8 +12,11 @@ namespace App\Http\Controllers\Bside;
use App\Enums\Common\Code;
use App\Http\Logic\Bside\News\NewsLogic;
use App\Models\Channel\Channel;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\CustomModule\CustomModuleExtentContent;
use App\Models\Domain\DomainInfo;
use App\Models\ExtentModule\ExtensionModuleValue;
use App\Models\Manage\ManageHr;
use App\Models\Project\CountAllProject as AllProject;
use App\Models\Project\Project;
... ... @@ -31,139 +34,8 @@ class TestController extends BaseController
* @time :2024/11/11 14:51
*/
public function ceshi(){
$data = $this->NoSixProject();
$this->response('success',Code::SUCCESS,$data);
$this->response('success',Code::SUCCESS,[]);
}
public function NoSixProject(){
$res_data = [];
// $i = 1;
// while (true){
$url = 'https://quanqiusou.cn/extend_api/api/projects.php?page=1&pagesize=1';
$result = http_get($url);
$data = $result['data'];
// if(empty($data)){
// break;
// }
// $res_data = array_merge($res_data,$data['data']);
// $i++;
// }
return $data;
}
public function SixProject(){
$projectModel = new Project();
$query = $projectModel->leftJoin('gl_project_payment', 'gl_project.id', '=', 'gl_project_payment.project_id')
->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
->where('gl_project.delete_status',Project::TYPE_ZERO);
$lists = $query->paginate(100000, $this->selectParam(), 'page', 1)->toArray();
$manageModel = new ManageHr();
foreach ($lists as $k => $v){
$allProjectModel = new AllProject();
$info = $allProjectModel->read(['version'=>1,'project_id'=>$v['id']],['id']);
if($info === false){
$channel = Channel::getChannelText($v['channel']['user_id'] ?? 0);
$data[] = [
'project_id'=>$v['id'],
'version'=>1,//代表6.0
'is_upgrade'=>$v['is_upgrade'],
'title'=>$v['title'],
'company'=>$v['company'],
'channel'=>$channel,
'sale'=>$this->end_channel($channel),
'join_date'=>$v['cooperate_date'],
'online_date'=>$v['uptime'],
'keywords_num'=>$v['key'],
'service_num'=>$v['day'],
'production_num'=>intval(abs(strtotime((empty($v['uptime']) ? date('Y-m-d H:i:s') : $v['uptime'])) - $v['created_at']) / 86400),
'plan'=>Project::planMap()[$v['plan']],
'status'=>$v['status'],
'test_domain'=>$v['test_domain'],
'product_domain'=>!empty($v['domain']) ? (new DomainInfo())->getDomain($v['domain']) : '',
'project_manager'=>$manageModel->getName($v['manager_mid'] ?? ''),
'project_group'=>$manageModel->getName($v['leader_mid'] ?? ''),
'project_design'=>$manageModel->getName($v['designer_mid'] ?? ''),
'project_assistant'=>$manageModel->getName($v['tech_mid'] ?? ''),
'service_manager'=>$manageModel->getName($v['optimize_manager_mid'] ??''),
'service_optimize'=>$manageModel->getName($v['optimize_optimist_mid'] ??''),
'service_assistant'=>$manageModel->getName($v['optimize_assist_mid'] ??''),
'qa'=>$manageModel->getName($v['quality_mid'] ??''),
];
$allProjectModel->add($data);
}else{
$data_edit = [
'title'=>$v['title'],
'company'=>$v['company'],
'channel'=>Channel::getChannelText($v['channel']['user_id'] ?? 0),
'sale'=>$this->end_channel($channel),
'join_date'=>$v['cooperate_date'],
'online_date'=>$v['uptime'],
'keywords_num'=>$v['key'],
'service_num'=>$v['day'],
'production_num'=>intval(abs(strtotime((empty($v['uptime']) ? date('Y-m-d H:i:s') : $v['uptime'])) - $v['created_at']) / 86400),
'plan'=>Project::planMap()[$v['plan']],
'status'=>$v['status'],
'test_domain'=>$v['test_domain'],
'product_domain'=>!empty($v['domain']) ? (new DomainInfo())->getDomain($v['domain']) : '',
'project_manager'=>$manageModel->getName($v['manager_mid'] ?? ''),
'project_group'=>$manageModel->getName($v['leader_mid'] ?? ''),
'project_design'=>$manageModel->getName($v['designer_mid'] ?? ''),
'project_assistant'=>$manageModel->getName($v['tech_mid'] ?? ''),
'service_manager'=>$manageModel->getName($v['optimize_manager_mid'] ??''),
'service_optimize'=>$manageModel->getName($v['optimize_optimist_mid'] ??''),
'service_assistant'=>$manageModel->getName($v['optimize_assist_mid'] ??''),
'qa'=>$manageModel->getName($v['quality_mid'] ??''),
];
$allProjectModel->edit($data_edit,['id'=>$info['id']]);
}
}
}
/**
* 需要查询的字段
* @return array
*/
public function selectParam(){
$select = [
'gl_project.id AS id',
'gl_project.title AS title',
'gl_project.channel AS channel',
'gl_project.company AS company',
'gl_project.type AS type',
'gl_project.extend_type AS extend_type',
'gl_project.uptime AS uptime',
'gl_project.is_upgrade AS is_upgrade',
'gl_project.created_at AS created_at',
'gl_project.cooperate_date AS cooperate_date',
'gl_project.site_status AS site_status',
'gl_project_deploy_build.keyword_num AS key',
'gl_project_deploy_build.service_duration AS day',
'gl_project_deploy_build.is_comment AS is_comment',
'gl_project_deploy_build.leader_mid AS leader_mid',
'gl_project_deploy_build.manager_mid AS manager_mid',
'gl_project_deploy_build.designer_mid AS designer_mid',
'gl_project_deploy_build.tech_mid AS tech_mid',
'gl_project_deploy_build.test_domain AS test_domain',
'gl_project_deploy_build.plan AS plan',
'gl_project_deploy_optimize.dept_id AS optimize_dept_id',
'gl_project_deploy_optimize.manager_mid AS optimize_manager_mid',
'gl_project_deploy_optimize.optimist_mid AS optimize_optimist_mid',
'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid',
'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid',
'gl_project_deploy_optimize.tech_leader AS tech_leader',
'gl_project_deploy_optimize.domain AS domain',
'gl_project_deploy_optimize.api_no AS api_no',
];
return $select;
}
public function end_channel($channel){
if(!empty($channel)){
$parts = explode("-", $channel);
return end($parts);
}
return $channel;
}
}
... ...
... ... @@ -234,8 +234,8 @@ class ImageController extends Controller
$tran_name = $tran_name[0];
}
$enName = generateRoute($tran_name);
if(substr($enName, 0, 1) === '-'){
$enName = md5(uniqid().$project_id.rand(1,1000));;
if(substr($enName, 0, 1) === '-' || empty($enName)){
$enName = md5(uniqid().$project_id.rand(1,1000));
}
$fileName = $enName;
$i=1;
... ...
... ... @@ -360,6 +360,8 @@ class UserLoginLogic
'data'=>$info
];
}
Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),
'project_id'=>$info['project_id'], 'type'=>2 ,'remark' => '自动登录,用户微信扫码']);
return $this->success($data);
}
... ...
... ... @@ -2,13 +2,16 @@
namespace App\Models\Inquiry;
use App\Enums\Common\Code;
use App\Helper\Arr;
use App\Helper\QuanqiusouApi;
use App\Models\Base;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Project;
use App\Models\Task\TaskOwner;
use App\Utils\HttpUtils;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
/**
* Class ReInquiryCount
... ... @@ -30,11 +33,12 @@ class ReInquiryCount extends Base
* @author zbj
* @date 2024/10/26
*/
public static function addInquiryNum($task_id, $domain, $num = 1)
public static function addInquiryNum($task_id, $domain, $num = 1, $type = 1, $company = '')
{
$model = self::where('domain', $domain)->first();
if (!$model) {
if($type == 1) {
//新增时获取公司名
$company = '';
$domain_info = DomainInfo::where('domain', $domain)->first();
... ... @@ -46,10 +50,20 @@ class ReInquiryCount extends Base
$company = $res['company_name'];
}
}
}
if($type == 2){
$company = $domain;
}
if($type == 3){
$fob_list = self::getFobProjects();
$fob = collect($fob_list)->where('postid', $domain)->first();
$company = $fob['company'] . ' - ' . $fob['plan'];
}
$model = new self();
$model->domain = $domain;
$model->company = $company;
$model->type = $type;
}
$model->task_ids = $model->task_ids + [$task_id];
$model->num = $model->num + $num;
... ... @@ -78,4 +92,15 @@ class ReInquiryCount extends Base
}
return $tasks;
}
public static function getFobProjects(){
$cache_key = 'GET_BIND_PROJECT_LIST';
$res = Cache::get($cache_key);
if(!$res){
$res = HttpUtils::get('https://fob.ai.cc/api/get_bind_project_list', []);
$res = json_decode($res, true)['data'] ?? [];
Cache::put($cache_key, $res, 120);
}
return $res;
}
}
... ...
... ... @@ -67,7 +67,7 @@ class ReInquiryDetail extends Model
* @return ReInquiryDetail
*/
public static function createInquiry($task_id, $form_id, $re_website, $country, $ip, $name, $email, $phone, $message, $text_id, $device_port,
$user_agent, $referrer, $urls, $is_v6, $start_at, $status = self::STATUS_INIT)
$user_agent, $referrer, $urls, $is_v6, $start_at, $status = self::STATUS_INIT, $type = 1)
{
$self = new self();
$self->task_id = $task_id;
... ... @@ -88,6 +88,7 @@ class ReInquiryDetail extends Model
$self->num = count($urls) + 1;
$self->start_at = $start_at;
$self->status = $status;
$self->type = $type;
$self->save();
return $self;
}
... ...
... ... @@ -105,6 +105,16 @@ How Much 写成 HM',
return $value;
}
public function getShopSiteAttribute($value)
{
return $value ? json_decode($value, true) : [];
}
public function getFobProAttribute($value)
{
return $value ? json_decode($value, true) : [];
}
public function setAiParamAttribute($value)
{
$this->attributes['ai_param'] = Arr::a2s($value);
... ...
... ... @@ -253,6 +253,11 @@ class SyncSubmitTaskService
throw new InquiryFilterException('测试环境过滤');
}
// 访问记录过滤测试环境
if ($type == SyncSubmitTask::TYPE_INQUIRY && FALSE !== strpos($domain, 'globalso.site') && !$project->is_record_test_inquiry) {
throw new InquiryFilterException('测试环境过滤');
}
if($ip == "127.0.0.1"){
throw new InquiryFilterException('127.0.0.1过滤');
}
... ...
... ... @@ -496,6 +496,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/fb_inquiry_chart', [Aside\Task\AdsController::class, 'fbInquiryChart'])->name('admin.fb_ads_inquiry_chart');
Route::any('/fb_relay_detail_list', [Aside\Task\AdsController::class, 'fbRelayDetail'])->name('admin.fb_ads_relay_detail_list');
Route::any('/fb_relay_count', [Aside\Task\AdsController::class, 'fbRelayCount'])->name('admin.fb_relay_count');
Route::any('/fob_projects', [Aside\Task\AdsController::class, 'fob_projects'])->name('admin.fob_projects');
});
//统计所有项目相关
... ...