作者 刘锟

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

... ... @@ -123,7 +123,7 @@ class postInquiry extends Command
'referrer_url' => $detail['referrer'],
'user_agent' => $detail['user_agent'],
];
$res = Http::withoutVerifying()->timeout(10)->post($website . 'api/traffic_visit/', $data)->json();
$res = Http::withoutVerifying()->timeout(30)->post($website . 'api/traffic_visit/', $data)->json();
if (empty($res['status']) || $res['status'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
... ... @@ -219,7 +219,7 @@ class postInquiry extends Command
} else {
$data['__amp_source_origin'] = trim($website, '/');
}
$res = Http::withoutVerifying()->timeout(10)->withHeaders(['User-Agent' => $detail['user_agent']])->post($website . 'api/inquiryQd?source=5', $data)->json();
$res = Http::withoutVerifying()->timeout(30)->withHeaders(['User-Agent' => $detail['user_agent']])->post($website . 'api/inquiryQd?source=5', $data)->json();
if (empty($res['code']) || $res['code'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
... ... @@ -243,7 +243,7 @@ class postInquiry extends Command
'source' => 5,
];
$result = Http::withoutVerifying()->timeout(10)->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data);
$result = Http::withoutVerifying()->timeout(30)->post('https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f', $data);
$res = $result->json();
//兼容接口返回格式
if (!empty($res['data'][0]['status'])) {
... ... @@ -273,7 +273,7 @@ class postInquiry extends Command
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()->timeout(10)->post($url, $data)->json();
$res = Http::withoutVerifying()->timeout(30)->post($url, $data)->json();
if (empty($res['code']) || $res['code'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
... ... @@ -292,7 +292,7 @@ class postInquiry extends Command
'post_id' => $log['url'],
'message' => $detail['message'],
];
$res = Http::withoutVerifying()->timeout(10)->post('https://fob.ai.cc/api/ad_to_scrm', $data)->json();
$res = Http::withoutVerifying()->timeout(30)->post('https://fob.ai.cc/api/ad_to_scrm', $data)->json();
if (empty($res['status']) || $res['status'] != 200) {
$log->status = ReInquiryDetailLog::STATUS_FAIL;
$log->remark = mb_substr($res['message'] ?? '', 0, 200);
... ...
... ... @@ -43,7 +43,7 @@ class SendProduct extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['deleted_status'=>0]);
$list = $projectModel->list(['delete_status'=>0]);
$data = [];
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
... ... @@ -56,16 +56,19 @@ class SendProduct extends Command
$arr1 = $this->sendProduct();
$arr2 = $this->sendBlog();
$arr3 = $this->sendNews();
$url = array_merge((array)$arr1,(array)$arr2,(array)$arr3);
if(!empty($url)){
$c_url = $domain.'api/update_page/';
$param = [
'project_id' => $this->user['project_id'],
'project_id' => $v['id'],
'type' => 1,
'route' => 3,
'url' => array_merge($arr1,$arr2,$arr3),
'url' => $url,
'language'=> [],
'is_sitemap' => 0
];
http_post($c_url, json_encode($param));
}
//TODO::通知C端生成界面
DB::disconnect('custom_mysql');
}
... ... @@ -80,10 +83,10 @@ class SendProduct extends Command
* @time :2024/8/30 14:44
*/
public function sendProduct(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$productModel = new Product();
$arr = $productModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('route');
$arr = $productModel->formatQuery(['send_time'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('route')->toArray();
$productModel->edit(['status'=>1],['send_time'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ... @@ -96,10 +99,10 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendBlog(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$blogModel = new Blog();
$arr = $blogModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url');
$arr = $blogModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url')->toArray();
$blogModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ... @@ -112,10 +115,10 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendNews(){
$start_date = date('Y-m-d H:i:s');
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$newsModel = new News();
$arr = $newsModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url');
$arr = $newsModel->formatQuery(['release_at'=>['between',[$start_date,$end_date]],'status'=>3])->pluck('url')->toArray();
$newsModel->edit(['status'=>1],['release_at'=>['between',[$start_date,$end_date]],'status'=>3]);
return $arr;
}
... ...
... ... @@ -42,11 +42,11 @@ class CopyProject extends Command
public function handle()
{
$projectModel = new Project();
while (true) {
$projectModel = new Project();
$list = NoticeLog::where('type', NoticeLog::TYPE_COPY_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
if(empty($list)){
sleep(5);
sleep(30);
continue;
}
foreach ($list as $item){
... ...
... ... @@ -65,6 +65,8 @@ class SendAutoEmail extends Command
Config::set('mail.mailers.smtp.password', $smtpInfo['password']);
Config::set('mail.from.address', $smtpInfo['email']);
Config::set('mail.from.name', $smtpInfo['from_name']);
Config::set('mail.mailers.smtp.port', 465); // 578 端口
Config::set('mail.mailers.smtp.encryption', 'ssl'); // 578 通常需要使用 TLS 加密
try {
$status = AutoEmailLog::STATUS_SUCCESS;
Mail::to([$info['email']])->send(new TextMail(['subject' => $info['title'], 'text' => $info['content']]));
... ...
... ... @@ -10,6 +10,7 @@ namespace App\Console\Commands\Test;
use App\Helper\Arr;
use App\Helper\Translate;
use App\Mail\TextMail;
use App\Models\Blog\Blog;
use App\Models\Blog\BlogCategory;
use App\Models\Com\KeywordVideoTask;
... ... @@ -30,6 +31,7 @@ use App\Models\News\NewsCategory;
use App\Models\Product\Keyword;
use App\Models\Product\KeywordRelated;
use App\Models\Product\Product;
use App\Models\Project\AutoEmailLog;
use App\Models\Project\DeployOptimize;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Project;
... ... @@ -40,12 +42,10 @@ use App\Models\Template\BCustomTemplate;
use App\Models\Template\BTemplateCom;
use App\Models\Template\Setting;
use App\Models\Template\Template;
use App\Services\AmazonS3Service;
use App\Services\ProjectServer;
use App\Utils\EncryptUtils;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Schema;
... ... @@ -74,6 +74,26 @@ class Demo extends Command
return $this->projectList();
}
public function toQueue(){
$info = [
'email' => '1123736022@qq.com', // 收件人邮箱
'title' => '测试邮件', // 邮件标题
'content' => '这是来自163邮箱的测试邮件', // 邮件内容
];
Config::set('mail.mailers.smtp.host', 'smtp.163.com');
Config::set('mail.mailers.smtp.username', 'lyh103433@163.com');
Config::set('mail.mailers.smtp.password', 'BMf8B327Nhncunnb');
Config::set('mail.from.address', 'lyh103433@163.com');
Config::set('mail.from.name', 'lyh');
try {
$status = AutoEmailLog::STATUS_SUCCESS;
Mail::to([$info['email']])->send(new TextMail(['subject' => $info['title'], 'text' => $info['content']]));
} catch (\Exception $e) {
$status = AutoEmailLog::STATUS_ERROR;
$this->output('任务:' . $info['id'] . ' 邮箱' . $info['email'] . '发送失败,' . $e->getMessage());
}
return $status;
}
public function projectList(){
$data = '深圳澄通睿视科技有限公司, 日照源洋包装材料有限公司, 河北途铂机电设备有限责任公司, 宁波市海曙玖鼎纸制品有限公司, 青岛众瑞智能仪器有限公司, 河北新秋国际贸易有限公司, 江西乔森电气有限公司, 沧州艾斯克粉业制造有限公司, 上海希然化工科技有限公司, 石家庄中创进出口有限公司, 东光县恒创利纸箱机械有限公司2021, 天津正能管业有限公司, 河北帷幄纺织有限公司, 广东顺德宝绅源环保科技有限公司, 石家庄艾文尔生物科技有限公司, 浙江福俄电气有限公司, 深圳市嘉盛数据科技有限公司, 江西米德实业有限公司, 苏州稼瑞机械有限公司, 青岛卓亚塑料机械有限公司, 宁波中力螺栓制造有限公司, 中山市万格电器有限公司, 廊坊禹神节水灌溉技术有限公司, 山东索玛特制帽有限公司, 蓝启生物技术(深圳)有限公司, 南宁奥展五金紧固件有限公司, 河北茉悠科技有限公司, 莱科阀门(天津)有限公司, 四川零点自动化系统有限公司, 厦门市戴尔乐新能源汽车有限公司, 宁波爱克利浦电器有限公司, 扬州天定成玩具礼品有限公司, 宁波市金典照明电器有限公司, 杭州法埃姆斯钢构有限公司, 北京迪文科技有限公司, 无锡动为储能科技有限公司, 河北唐蕴生物科技有限公司, 绍兴苏尔黛纺织品有限公司, 河北祈强金属制品有限公司, 上池诊断科技(深圳)有限公司, 泉州市三颖超硬工具有限公司, 宁波杰广电子有限公司, 石家庄德烨管业有限公司, 山东凯特钻具有限公司, 北京思普瑞特科技发展有限公司, 广州市印科标识科技有限公司, 优之科技(深圳)有限公司, 南通赫美特国际贸易有限公司, 天津誉瑞特品科技有限公司, 河北坤焰建材科技有限公司, 绍兴睿博机械有限公司, 西安法斯拓进出口有限公司, 深圳市德诺威电子有限公司, 百润(中国)有限公司, 达时科科技有限责任公司, 陈海英, 四川蓉腾自动化设备有限公司, 石家庄晋吉建材科技有限公司, 石家庄安瑞科气体机械有限公司, 深圳市扬帆纸制品有限公司, 舟山威尔曼机械科技有限公司, 佰纳通科技(北京)有限公司, 宁波嘉佑行科技有限公司, 东莞市凯信脚轮有限公司, 宝鸡轩泰颜料科技有限公司, 东莞市华腾五金制品有限公司, 深圳市思锐宇光电有限公司, 东莞市奥彩数码科技有限公司, 上海垂普国际贸易有限公司, 扬州爱拓户外用品有限公司, 余姚市立鑫电子有限公司, 晋州市金昌盛化工有限公司, 广东阿酷达箱包科技有限公司, 泉州市杰斯特仪器设备有限公司, 三和长兴科技有限公司, 佛山市精一家具有限公司谷腾分公司, 天津市洁雅妇女卫生保健制品有限公司, 江西海瑞天然植物有限公司, 九江贝海玻纤有限公司(客户做新站), 瑞安市齐笙科技有限公司, 石家庄华圣方洲国际贸易有限公司, 深圳市方成教学设备有限公司, 连云港索娜斯贸易有限公司, 睿華電子有限公司, 扬州市极盛照明有限公司, 天津市实丰国际贸易有限责任公司, 厦门亚迅工贸有限公司, 威海旺展旅游用品有限公司, 宁波首安纸业有限公司, 浙江乐马电气有限公司, 广东金莱特智能科技有限公司, 河北科星药业有限公司, 宁波迈可森汽配有限公司, 邯郸市常岚紧固件制造有限公司, 宁波市晶艳贸易有限公司, 苏州荃华生物材料有限公司, 青岛洛城通信息科技有限公司, 合肥领派克机械设备有限公司, 广西绿城工贸有限公司, 一元电气科技有限公司【主站】, 立圣丰(厦门)纺织科技有限公司, 深圳市汉瑞通科技有限公司, 扬州市润芳塑胶包装材料有限公司, 扬州浩邦新能源科技有限公司项目2, 深圳市锦昊安科技有限公司, 四川途乐乐科技有限公司, 天津广大纸业股份有限公司, 西安禾为生物科技有限公司, 西安奥谷生物科技有限公司, 佛山市三水歌谷电器有限公司, 西安麦克斯农用化学有限公司, 瑞安市富锐思进出口有限公司(黑格客户), 北京新科以仁科技发展有限公司, 镇江市惠灵顿膜业有限公司';
$arr = explode(',',$data);
... ...
... ... @@ -313,7 +313,7 @@ class CustomModuleContentLogic extends BaseLogic
}
$v['project_id'] = $this->user['project_id'];
$v['content_id'] = $content_id;
$v['module_id'] = $content_id;
$v['module_id'] = $this->param['module_id'];
return $this->success($v);
}
... ...
... ... @@ -426,6 +426,8 @@ class ProductLogic extends BaseLogic
public function productDelete(){
DB::connection('custom_mysql')->beginTransaction();
try {
$columnModel = new Column();
$detailModel = new Detail();
$cateRelate = new CategoryRelated();
//删除扩展字段
$extendInfoModel = new ExtendInfo();
... ... @@ -441,6 +443,9 @@ class ProductLogic extends BaseLogic
//删除关联表
$cateRelate->del(['product_id'=>$id]);
$extendInfoModel->del(['product_id'=>$id]);
//删除描述
$columnModel->del(['product_id'=>$id]);
$detailModel->del(['product_id'=>$id]);
}else{
$this->delRoute($id);
//回收站
... ...
... ... @@ -489,8 +489,13 @@ class RankDataLogic extends BaseLogic
$without_extension_project_ids = [658]; //是否达标只统计主词的
$extension_project_ids = [354]; //扩展词也到达标的
$ceaseProjectId = [
47,
354,
1283
378,
649,
1283,
1893,
2066
];//暂停项目id
//一个项目多个api_no
... ...
... ... @@ -74,11 +74,12 @@ class TranslateLogic extends BaseLogic
}
$arr2 = [];
foreach ($text_array as $val) {
$val = urldecode($val);
$val = str_replace(' ','',$val);//处理特殊字符
$val = trim(str_replace(' ','',$val));
if($val == ' ' || $val == ''){
continue;
}
$val = str_replace(' ','',urldecode($val));//处理特殊字符
$val = trim(str_replace(' ','',$val));
if (FALSE == in_array($val, $old_key)){
$arr2[] = $val;
}
... ...