Merge remote-tracking branch 'origin/master' into akun
正在显示
7 个修改的文件
包含
23 行增加
和
20 行删除
| @@ -312,7 +312,7 @@ class AiBlogTask extends Command | @@ -312,7 +312,7 @@ class AiBlogTask extends Command | ||
| 312 | }else{ | 312 | }else{ |
| 313 | $url = $domain.'api/update_page/?project_id='.$project_id.'&route=7'; | 313 | $url = $domain.'api/update_page/?project_id='.$project_id.'&route=7'; |
| 314 | $res = http_get($url); | 314 | $res = http_get($url); |
| 315 | - echo '返回数据:'.json_encode($res,true).PHP_EOL; | 315 | + echo '通知C端:'.json_encode($res,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).PHP_EOL; |
| 316 | } | 316 | } |
| 317 | }else{ | 317 | }else{ |
| 318 | echo '域名不存在:' . $project_id . PHP_EOL . date('Y-m-d H:i:s'); | 318 | echo '域名不存在:' . $project_id . PHP_EOL . date('Y-m-d H:i:s'); |
| @@ -28,7 +28,7 @@ class RemainDay extends Command | @@ -28,7 +28,7 @@ class RemainDay extends Command | ||
| 28 | * @var 按上线时间统计 | 28 | * @var 按上线时间统计 |
| 29 | */ | 29 | */ |
| 30 | protected $projectId = [ | 30 | protected $projectId = [ |
| 31 | - 1434,1812,276,2414 | 31 | + 1434,1812,276,2414,2974 |
| 32 | ];//需要单独处理的项目 | 32 | ];//需要单独处理的项目 |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| @@ -196,11 +196,11 @@ class VideoTask extends Command | @@ -196,11 +196,11 @@ class VideoTask extends Command | ||
| 196 | { | 196 | { |
| 197 | 197 | ||
| 198 | $keyword_id = Keyword::where('video', null)->whereIn("title", $keywords)->whereNull('deleted_at') | 198 | $keyword_id = Keyword::where('video', null)->whereIn("title", $keywords)->whereNull('deleted_at') |
| 199 | - ->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->limit($number)->pluck('id')->toArray(); | 199 | + ->where('route', 'not like', '%-tag')->whereNotNull('keyword_content')->inRandomOrder()->take($number)->pluck('id')->toArray(); |
| 200 | $need = $number - count($keyword_id); | 200 | $need = $number - count($keyword_id); |
| 201 | if ($need > 0) { | 201 | if ($need > 0) { |
| 202 | $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag')->whereNull('deleted_at') | 202 | $keyword_arr_id = Keyword::where('video', null)->where('route', 'not like', '%-tag')->whereNull('deleted_at') |
| 203 | - ->whereNotNull('keyword_content')->whereNotIn('id', $keyword_id)->orderBy('id','asc')->limit($need)->pluck('id')->toArray(); | 203 | + ->whereNotNull('keyword_content')->whereNotIn('id', $keyword_id)->orderBy('id','asc')->inRandomOrder()->take($need)->pluck('id')->toArray(); |
| 204 | } | 204 | } |
| 205 | $keyword_arr_id = array_merge($keyword_id, $keyword_arr_id); | 205 | $keyword_arr_id = array_merge($keyword_id, $keyword_arr_id); |
| 206 | $keyword = Keyword::whereIn("id", $keyword_arr_id)->get(); | 206 | $keyword = Keyword::whereIn("id", $keyword_arr_id)->get(); |
| @@ -323,9 +323,12 @@ class VideoTask extends Command | @@ -323,9 +323,12 @@ class VideoTask extends Command | ||
| 323 | $logo = $bg = ''; | 323 | $logo = $bg = ''; |
| 324 | try { | 324 | try { |
| 325 | $dom = file_get_html('https://'.$domainInfo['domain'].'/'); | 325 | $dom = file_get_html('https://'.$domainInfo['domain'].'/'); |
| 326 | - $logoDom = $dom->find('.logo', 0)->find("img",0); | ||
| 327 | - if($logoDom != null){ | ||
| 328 | - $logo = $logoDom->src; | 326 | + $logoDom = $dom->find('.logo', 0); |
| 327 | + if ($logoDom) { | ||
| 328 | + $logoDomImg = $logoDom->find("img",0); | ||
| 329 | + if($logoDomImg != null){ | ||
| 330 | + $logo = $logoDomImg->src; | ||
| 331 | + } | ||
| 329 | } | 332 | } |
| 330 | $elements = $dom->find('.section-banner-wrap-block'); | 333 | $elements = $dom->find('.section-banner-wrap-block'); |
| 331 | if (count($elements) >= 2) { | 334 | if (count($elements) >= 2) { |
| @@ -52,9 +52,9 @@ class LyhImportTest extends Command | @@ -52,9 +52,9 @@ class LyhImportTest extends Command | ||
| 52 | * @time :2023/11/20 15:13 | 52 | * @time :2023/11/20 15:13 |
| 53 | */ | 53 | */ |
| 54 | public function handle(){ | 54 | public function handle(){ |
| 55 | - ProjectServer::useProject(2140); | 55 | + ProjectServer::useProject(2878); |
| 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; | 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; |
| 57 | - $this->import2140CustomModule('https://ecdn6.globalso.com/upload/p/2140/file/2025-03/2140.csv',2140); | 57 | + $this->importProductCategory('https://ecdn6.globalso.com/upload/p/2878/file/2025-03/products.csv',2878); |
| 58 | DB::disconnect('custom_mysql'); | 58 | DB::disconnect('custom_mysql'); |
| 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 60 | } | 60 | } |
| @@ -93,15 +93,15 @@ class LyhImportTest extends Command | @@ -93,15 +93,15 @@ class LyhImportTest extends Command | ||
| 93 | continue; | 93 | continue; |
| 94 | } | 94 | } |
| 95 | try { | 95 | try { |
| 96 | - $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2],'sort'=>$val[3]]); | 96 | + $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]); |
| 97 | $pid = 0; | 97 | $pid = 0; |
| 98 | -// if($val[2] != 0){ | ||
| 99 | -// //查询上级id | ||
| 100 | -// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 101 | -// if($pidCate !== false){ | ||
| 102 | -// $pid = $pidCate['id']; | ||
| 103 | -// } | ||
| 104 | -// } | 98 | + if($val[2] != 0){ |
| 99 | + //查询上级id | ||
| 100 | + $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 101 | + if($pidCate !== false){ | ||
| 102 | + $pid = $pidCate['id']; | ||
| 103 | + } | ||
| 104 | + } | ||
| 105 | $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | 105 | $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); |
| 106 | $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); | 106 | $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); |
| 107 | echo date('Y-m-d H:i:s') . '产品分类id:'. $id.PHP_EOL; | 107 | echo date('Y-m-d H:i:s') . '产品分类id:'. $id.PHP_EOL; |
| @@ -119,7 +119,7 @@ if (!function_exists('http_get')) { | @@ -119,7 +119,7 @@ if (!function_exists('http_get')) { | ||
| 119 | $access_txt = curl_exec($ch1); | 119 | $access_txt = curl_exec($ch1); |
| 120 | if (curl_errno($ch1)) { | 120 | if (curl_errno($ch1)) { |
| 121 | $error_message = curl_error($ch1); | 121 | $error_message = curl_error($ch1); |
| 122 | - errorLog('请求失败', $url, $error_message); | 122 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($error_message, true) . PHP_EOL, FILE_APPEND); |
| 123 | } | 123 | } |
| 124 | curl_close($ch1); | 124 | curl_close($ch1); |
| 125 | return json_decode($access_txt, true); | 125 | return json_decode($access_txt, true); |
| @@ -490,7 +490,7 @@ class RankDataLogic extends BaseLogic | @@ -490,7 +490,7 @@ class RankDataLogic extends BaseLogic | ||
| 490 | $without_extension_project_ids = [658]; //是否达标只统计主词的 | 490 | $without_extension_project_ids = [658]; //是否达标只统计主词的 |
| 491 | $extension_project_ids = [354]; //扩展词也到达标的 | 491 | $extension_project_ids = [354]; //扩展词也到达标的 |
| 492 | $compliance_project_ids = [2163,257,823]; //直接达标处理的 | 492 | $compliance_project_ids = [2163,257,823]; //直接达标处理的 |
| 493 | - $ceaseProjectId = [47, 354, 378, 649, 1226, 1283, 1703, 1893, 2066,];//暂停项目id | 493 | + $ceaseProjectId = [47, 354, 378, 649, 1226, 1283, 1703, 1893, 2066,2974];//暂停项目id |
| 494 | //一个项目多个api_no | 494 | //一个项目多个api_no |
| 495 | $multiple_api_no_project_ids = [ | 495 | $multiple_api_no_project_ids = [ |
| 496 | 2104 => [ | 496 | 2104 => [ |
| @@ -83,7 +83,7 @@ class SyncSubmitTaskService | @@ -83,7 +83,7 @@ class SyncSubmitTaskService | ||
| 83 | //是否是小语种 二级域名或二级目录 | 83 | //是否是小语种 二级域名或二级目录 |
| 84 | $langs = WebLanguage::getShorts(); | 84 | $langs = WebLanguage::getShorts(); |
| 85 | foreach ($langs as $lang){ | 85 | foreach ($langs as $lang){ |
| 86 | - if(Str::contains($data['data']['url'], [$lang . '.' .$data['domain'], $data['domain'] . '/' . $lang. '/'])){ | 86 | + if(Str::contains($data['data']['url'], ['/' . $lang . '.', '/' . $lang . '/'])) { |
| 87 | $tran_visit = $lang; | 87 | $tran_visit = $lang; |
| 88 | break; | 88 | break; |
| 89 | } | 89 | } |
-
请 注册 或 登录 后发表评论