Merge remote-tracking branch 'origin/master' into akun
正在显示
16 个修改的文件
包含
199 行增加
和
54 行删除
app/Console/Commands/Ai/AiDomainTask.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :AiDomainTask.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/6/19 10:53 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Console\Commands\Ai; | ||
| 11 | + | ||
| 12 | +use App\Models\Domain\DomainInfo; | ||
| 13 | +use Illuminate\Console\Command; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @remark :拉取项目Ai域名 | ||
| 17 | + * @name :AiDomainTask | ||
| 18 | + * @author :lyh | ||
| 19 | + * @method :post | ||
| 20 | + * @time :2025/6/19 10:54 | ||
| 21 | + */ | ||
| 22 | +class AiDomainTask extends Command | ||
| 23 | +{ | ||
| 24 | + /** | ||
| 25 | + * The name and signature of the console command. | ||
| 26 | + * | ||
| 27 | + * @var string | ||
| 28 | + */ | ||
| 29 | + protected $signature = 'ai_domain'; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * The console command description. | ||
| 33 | + * | ||
| 34 | + * @var string | ||
| 35 | + */ | ||
| 36 | + protected $description = '获取对应域名的ai复制站域名'; | ||
| 37 | + | ||
| 38 | + public $url = 'https://www.cmer.site/api/globalso_site'; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * @remark :执行方法 | ||
| 42 | + * @name :handle | ||
| 43 | + * @author :lyh | ||
| 44 | + * @method :post | ||
| 45 | + * @time :2025/6/19 11:32 | ||
| 46 | + */ | ||
| 47 | + public function handle(){ | ||
| 48 | + $pageSize = 300; | ||
| 49 | + $page = 1; | ||
| 50 | + $res = http_get($this->url.'?pagesize='.$pageSize.'&page='.$page); | ||
| 51 | + if($res['status'] != 200){ | ||
| 52 | + echo date('Y-m-d H:i:s').'请求失败,状态码错误'.PHP_EOL; | ||
| 53 | + return false; | ||
| 54 | + } | ||
| 55 | + if(empty($res['data']['data'])){ | ||
| 56 | + echo date('Y-m-d H:i:s').'请求失败,未拉取到数据'.PHP_EOL; | ||
| 57 | + return false; | ||
| 58 | + } | ||
| 59 | + $data = $res['data']['data']; | ||
| 60 | + while($page <= $res['data']['last_page']){ | ||
| 61 | + $res = http_get($this->url.'?pagesize='.$pageSize.'&page='.$page); | ||
| 62 | + if($res['status'] != 200){ | ||
| 63 | + echo date('Y-m-d H:i:s').'第'.$page.'请求失败,未拉取到数据'.PHP_EOL; | ||
| 64 | + return false; | ||
| 65 | + } | ||
| 66 | + $data = array_values(array_merge($data,$res['data']['data'])); | ||
| 67 | + $page++; | ||
| 68 | + } | ||
| 69 | + //处理数据 | ||
| 70 | + $this->handleData($data); | ||
| 71 | + echo 'end'.PHP_EOL; | ||
| 72 | + return true; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * @remark :处理数据 | ||
| 77 | + * @name :handleData | ||
| 78 | + * @author :lyh | ||
| 79 | + * @method :post | ||
| 80 | + * @time :2025/6/19 11:21 | ||
| 81 | + */ | ||
| 82 | + public function handleData($data){ | ||
| 83 | + $domainInfoModel = new DomainInfo(); | ||
| 84 | + foreach ($data as $item){ | ||
| 85 | + $info = $domainInfoModel->read(['domain'=>$item['domain']],'id'); | ||
| 86 | + if($info === false){ | ||
| 87 | + $info = $domainInfoModel->read(['domain'=>$item['globalso_domain']],'id'); | ||
| 88 | + if($info !== false){ | ||
| 89 | + $domainInfoModel->edit(['ai_domain'=>$item['domain']],['id'=>$info['id']]); | ||
| 90 | + } | ||
| 91 | + }else{ | ||
| 92 | + $domainInfoModel->edit(['ai_domain'=>$item['globalso_domain']],['id'=>$info['id']]); | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | + return true; | ||
| 96 | + } | ||
| 97 | +} |
| @@ -736,7 +736,12 @@ class RelayInquiry extends Command | @@ -736,7 +736,12 @@ class RelayInquiry extends Command | ||
| 736 | // 所有可用url | 736 | // 所有可用url |
| 737 | $urls = $inquiry_urls = []; | 737 | $urls = $inquiry_urls = []; |
| 738 | //入口url 首页30%,单页10%,聚合页60% | 738 | //入口url 首页30%,单页10%,聚合页60% |
| 739 | - $type = getRandByRatio([40,20,40]); | 739 | + if ($re_website == 'https://www.hikelok.com/') { |
| 740 | + $type = getRandByRatio([50,49,1]); | ||
| 741 | + } else { | ||
| 742 | + $type = getRandByRatio([40,20,40]); | ||
| 743 | + } | ||
| 744 | + | ||
| 740 | $inlet = $re_website; | 745 | $inlet = $re_website; |
| 741 | $type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website; | 746 | $type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website; |
| 742 | $type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website; | 747 | $type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website; |
| @@ -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(3951); | 55 | + ProjectServer::useProject(3654); |
| 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-05/daoru.csv',3951); | 57 | + $this->importProductCategory('https://ecdn6-nc.globalso.com/upload/p/3654/file/2025-06/products-1.csv',3654); |
| 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 | } |
| @@ -129,23 +129,43 @@ class LyhImportTest extends Command | @@ -129,23 +129,43 @@ class LyhImportTest extends Command | ||
| 129 | if($k < 1){ | 129 | if($k < 1){ |
| 130 | continue; | 130 | continue; |
| 131 | } | 131 | } |
| 132 | - if(empty($val[1])){ | ||
| 133 | - echo '跳过的名称:'.$val[1]; | 132 | + if(empty($val[0])){ |
| 133 | + echo '跳过的名称:'.$val[0]; | ||
| 134 | continue; | 134 | continue; |
| 135 | } | 135 | } |
| 136 | try { | 136 | try { |
| 137 | - $categoryModel->edit(['sort'=>$val[1]],['title'=>$val[0]]); | ||
| 138 | -// $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]); | ||
| 139 | -// $pid = 0; | ||
| 140 | -// if($val[2] != 0){ | ||
| 141 | -// //查询上级id | ||
| 142 | -// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 143 | -// if($pidCate !== false){ | ||
| 144 | -// $pid = $pidCate['id']; | ||
| 145 | -// } | ||
| 146 | -// } | ||
| 147 | -// $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 148 | -// $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); | 137 | + $cateArr = explode('/',$val[0]); |
| 138 | + $pid = 0; | ||
| 139 | + $two_pid = 0; | ||
| 140 | + foreach ($cateArr as $key => $item){ | ||
| 141 | + if($key == 0){ | ||
| 142 | + //查看一级分类是否存在 | ||
| 143 | + $info = $categoryModel->read(['title'=>$item,'pid'=>0],['id']); | ||
| 144 | + if($info === false){ | ||
| 145 | + $pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item]); | ||
| 146 | + //设置路由 | ||
| 147 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$pid,$project_id); | ||
| 148 | + $categoryModel->edit(['route'=>$route],['id'=>$pid]); | ||
| 149 | + }else{ | ||
| 150 | + $pid = $info['id']; | ||
| 151 | + } | ||
| 152 | + }elseif ($key == 1){ | ||
| 153 | + //查看当前下面的子级别是否存在 | ||
| 154 | + $two_info = $categoryModel->read(['title'=>$item,'pid'=>$pid],['id']); | ||
| 155 | + if($two_info === false){ | ||
| 156 | + $two_pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$pid]); | ||
| 157 | + //设置路由 | ||
| 158 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$two_pid,$project_id); | ||
| 159 | + $categoryModel->edit(['route'=>$route],['id'=>$two_pid]); | ||
| 160 | + }else{ | ||
| 161 | + $two_pid = $two_info['id']; | ||
| 162 | + } | ||
| 163 | + }else{ | ||
| 164 | + $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$two_pid]); | ||
| 165 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 166 | + $categoryModel->edit(['route'=>$route],['id'=>$id]); | ||
| 167 | + } | ||
| 168 | + } | ||
| 149 | echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; | 169 | echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; |
| 150 | }catch (\Exception $e){ | 170 | }catch (\Exception $e){ |
| 151 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; | 171 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; |
| @@ -58,28 +58,7 @@ class lyhDemo extends Command | @@ -58,28 +58,7 @@ class lyhDemo extends Command | ||
| 58 | protected $description = '更新路由'; | 58 | protected $description = '更新路由'; |
| 59 | 59 | ||
| 60 | public function handle(){ | 60 | public function handle(){ |
| 61 | - $projectModel = new Project(); | ||
| 62 | - $buildModel = new DeployBuild(); | ||
| 63 | - $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'is_upgrade'=>0,'id'=>['<',1659],'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id','notice_order_id']); | ||
| 64 | - foreach ($lists as $item){ | ||
| 65 | - echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 66 | - try { | ||
| 67 | - if(!empty($item['notice_order_id'])){ | ||
| 68 | - $api = new OaGlobalsoApi(); | ||
| 69 | - $data = $api->order_info($item['notice_order_id']); | ||
| 70 | - if(!empty($data)){ | ||
| 71 | - if(isset($data['data']['ads_price'])){ | ||
| 72 | - echo '奖励金额:'.$data['data']['ads_price'].PHP_EOL; | ||
| 73 | - $buildModel->edit(['ads_price'=>$data['data']['ads_price'] ?? 0],['project_id'=>$item['id']]); | ||
| 74 | - } | ||
| 75 | - } | ||
| 76 | - } | ||
| 77 | - }catch (\Exception $e){ | ||
| 78 | - continue; | ||
| 79 | - } | ||
| 80 | - DB::disconnect('custom_mysql'); | ||
| 81 | - } | ||
| 82 | - echo date('Y-m-d H:i:s') . '结束。。。' . PHP_EOL; | 61 | + |
| 83 | } | 62 | } |
| 84 | 63 | ||
| 85 | public function _actionTemplateMain(){ | 64 | public function _actionTemplateMain(){ |
| @@ -183,6 +183,7 @@ class CountAllProject extends Command | @@ -183,6 +183,7 @@ class CountAllProject extends Command | ||
| 183 | } | 183 | } |
| 184 | } | 184 | } |
| 185 | $channel = Channel::getChannelText($v['channel']['user_id'] ?? 0); | 185 | $channel = Channel::getChannelText($v['channel']['user_id'] ?? 0); |
| 186 | + $plan = Project::planMap(); | ||
| 186 | $data[] = [ | 187 | $data[] = [ |
| 187 | 'project_id'=>$v['id'], | 188 | 'project_id'=>$v['id'], |
| 188 | 'version'=>1,//代表6.0 | 189 | 'version'=>1,//代表6.0 |
| @@ -196,7 +197,7 @@ class CountAllProject extends Command | @@ -196,7 +197,7 @@ class CountAllProject extends Command | ||
| 196 | 'keywords_num'=>$v['key'], | 197 | 'keywords_num'=>$v['key'], |
| 197 | 'service_num'=>$v['day'], | 198 | 'service_num'=>$v['day'], |
| 198 | 'production_num'=>intval(abs((empty($v['uptime']) ? time() : strtotime($v['uptime'])) - strtotime($v['created_at'])) / 86400), | 199 | 'production_num'=>intval(abs((empty($v['uptime']) ? time() : strtotime($v['uptime'])) - strtotime($v['created_at'])) / 86400), |
| 199 | - 'plan'=>Project::planMap()[$v['plan']], | 200 | + 'plan'=>$plan[$v['plan']] ?? '无版本信息', |
| 200 | 'status'=>$type, | 201 | 'status'=>$type, |
| 201 | 'category'=>$category, | 202 | 'category'=>$category, |
| 202 | 'is_admin5' => 6, | 203 | 'is_admin5' => 6, |
| @@ -51,11 +51,12 @@ class GeneratePage extends Command | @@ -51,11 +51,12 @@ class GeneratePage extends Command | ||
| 51 | { | 51 | { |
| 52 | $noticeModel = new NoticeLog(); | 52 | $noticeModel = new NoticeLog(); |
| 53 | while (true){ | 53 | while (true){ |
| 54 | - $noticeInfo = $noticeModel->read(['status'=>0,'type'=>$noticeModel::GENERATE_PAGE,'start_at'=>['<=',date('Y-m-d H:i:s')]]); | 54 | + $task_id = $this->getTaskId(); |
| 55 | if (empty($noticeInfo)) { | 55 | if (empty($noticeInfo)) { |
| 56 | sleep(10); | 56 | sleep(10); |
| 57 | continue; | 57 | continue; |
| 58 | } | 58 | } |
| 59 | + $noticeInfo = $noticeModel->read(['id'=>$task_id]); | ||
| 59 | try { | 60 | try { |
| 60 | $this->output(' taskID: ' . $noticeInfo['id'] . ' start'); | 61 | $this->output(' taskID: ' . $noticeInfo['id'] . ' start'); |
| 61 | $notice_data = json_decode($noticeInfo['data'],true); | 62 | $notice_data = json_decode($noticeInfo['data'],true); |
| @@ -80,6 +81,28 @@ class GeneratePage extends Command | @@ -80,6 +81,28 @@ class GeneratePage extends Command | ||
| 80 | return true; | 81 | return true; |
| 81 | } | 82 | } |
| 82 | 83 | ||
| 84 | + /** | ||
| 85 | + * @remark :获取任务id | ||
| 86 | + * @name :getTaskId | ||
| 87 | + * @author :lyh | ||
| 88 | + * @method :post | ||
| 89 | + * @time :2025/6/19 10:02 | ||
| 90 | + */ | ||
| 91 | + public function getTaskId() | ||
| 92 | + { | ||
| 93 | + $task_id = Redis::rpop('generate_page_id'); | ||
| 94 | + if (empty($task_id)) { | ||
| 95 | + $noticeModel = new NoticeLog(); | ||
| 96 | + $ids = $noticeModel->selectField(['status'=>0],'id'); | ||
| 97 | + if(!empty($ids)){ | ||
| 98 | + foreach ($ids as $id) { | ||
| 99 | + Redis::lpush('generate_page_id', $id); | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + $task_id = Redis::rpop('generate_page_id'); | ||
| 103 | + } | ||
| 104 | + return $task_id; | ||
| 105 | + } | ||
| 83 | 106 | ||
| 84 | /** | 107 | /** |
| 85 | * 输出message | 108 | * 输出message |
| @@ -61,7 +61,7 @@ if (!function_exists('http_post')) { | @@ -61,7 +61,7 @@ if (!function_exists('http_post')) { | ||
| 61 | * @param type $url | 61 | * @param type $url |
| 62 | * @param type $post_data | 62 | * @param type $post_data |
| 63 | */ | 63 | */ |
| 64 | - function http_post($url, $post_data, $header = [],$is_json = true) | 64 | + function http_post($url, $post_data, $header = [],$is_json = true,$timeout = 60) |
| 65 | { | 65 | { |
| 66 | if (empty($header)) { | 66 | if (empty($header)) { |
| 67 | $header = array( | 67 | $header = array( |
| @@ -73,6 +73,7 @@ if (!function_exists('http_post')) { | @@ -73,6 +73,7 @@ if (!function_exists('http_post')) { | ||
| 73 | curl_setopt($ch, CURLOPT_URL, $url); | 73 | curl_setopt($ch, CURLOPT_URL, $url); |
| 74 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | 74 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
| 75 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | 75 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); |
| 76 | + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); | ||
| 76 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); | 77 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); |
| 77 | curl_setopt($ch, CURLOPT_HTTPHEADER, $header); | 78 | curl_setopt($ch, CURLOPT_HTTPHEADER, $header); |
| 78 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)'); | 79 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)'); |
| @@ -1189,7 +1190,7 @@ function getDeployOptimize($project_id){ | @@ -1189,7 +1190,7 @@ function getDeployOptimize($project_id){ | ||
| 1189 | $info = Cache::get($cache_key); | 1190 | $info = Cache::get($cache_key); |
| 1190 | if(!$info){ | 1191 | if(!$info){ |
| 1191 | $projectOptimizeModel = new DeployOptimize(); | 1192 | $projectOptimizeModel = new DeployOptimize(); |
| 1192 | - $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'keyword_prefix', 'keyword_suffix']); | 1193 | + $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'keyword_prefix', 'keyword_suffix', 'special']); |
| 1193 | $projectKeywordModel = new ProjectKeyword(); | 1194 | $projectKeywordModel = new ProjectKeyword(); |
| 1194 | $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); | 1195 | $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); |
| 1195 | $info['main_keyword'] = ''; | 1196 | $info['main_keyword'] = ''; |
| @@ -142,7 +142,7 @@ class IndexController extends BaseController | @@ -142,7 +142,7 @@ class IndexController extends BaseController | ||
| 142 | Cache::add($token,$info,12 * 3600); | 142 | Cache::add($token,$info,12 * 3600); |
| 143 | $languageModel = new WebLanguage(); | 143 | $languageModel = new WebLanguage(); |
| 144 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); | 144 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); |
| 145 | - $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo]; | 145 | + $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo,'project_seo_type'=>$info['project_seo_type']]; |
| 146 | $this->response('success',Code::SUCCESS,$data); | 146 | $this->response('success',Code::SUCCESS,$data); |
| 147 | } | 147 | } |
| 148 | 148 |
| @@ -51,10 +51,10 @@ class UpdateController extends BaseController | @@ -51,10 +51,10 @@ class UpdateController extends BaseController | ||
| 51 | if (empty($info['company_en_description'])) { | 51 | if (empty($info['company_en_description'])) { |
| 52 | $this->fail('公司英文描述未设置'); | 52 | $this->fail('公司英文描述未设置'); |
| 53 | } | 53 | } |
| 54 | - if (empty($info['keyword_prefix'])) { | 54 | + if (empty($info['keyword_prefix']) && !in_array(8, explode(',', $info['special']))) { |
| 55 | $this->fail('前缀关键词未设置'); | 55 | $this->fail('前缀关键词未设置'); |
| 56 | } | 56 | } |
| 57 | - if (empty($info['keyword_suffix'])) { | 57 | + if (empty($info['keyword_suffix']) && !in_array(8, explode(',', $info['special']))) { |
| 58 | $this->fail('后缀关键词未设置'); | 58 | $this->fail('后缀关键词未设置'); |
| 59 | } | 59 | } |
| 60 | try { | 60 | try { |
| @@ -234,6 +234,7 @@ class OptimizeController extends BaseController | @@ -234,6 +234,7 @@ class OptimizeController extends BaseController | ||
| 234 | 'gl_project_deploy_optimize.first_compliance_time AS first_compliance_time', | 234 | 'gl_project_deploy_optimize.first_compliance_time AS first_compliance_time', |
| 235 | 'gl_domain_info.amp_status AS amp_status', | 235 | 'gl_domain_info.amp_status AS amp_status', |
| 236 | 'gl_domain_info.domain AS domain', | 236 | 'gl_domain_info.domain AS domain', |
| 237 | + 'gl_domain_info.ai_domain AS ai_domain', | ||
| 237 | ]; | 238 | ]; |
| 238 | return $select; | 239 | return $select; |
| 239 | } | 240 | } |
| @@ -262,6 +263,9 @@ class OptimizeController extends BaseController | @@ -262,6 +263,9 @@ class OptimizeController extends BaseController | ||
| 262 | if(isset($this->map['ai_video']) && !empty($this->map['ai_video'])){ | 263 | if(isset($this->map['ai_video']) && !empty($this->map['ai_video'])){ |
| 263 | $query = $query->where('gl_project_deploy_optimize.ai_video',$this->map['ai_video']); | 264 | $query = $query->where('gl_project_deploy_optimize.ai_video',$this->map['ai_video']); |
| 264 | } | 265 | } |
| 266 | + if(isset($this->map['ai_domain']) && !empty($this->map['ai_domain'])){ | ||
| 267 | + $query = $query->whereNotNull('gl_domain_info.ai_domain'); | ||
| 268 | + } | ||
| 265 | if(isset($this->map['amp_status'])){ | 269 | if(isset($this->map['amp_status'])){ |
| 266 | $query = $query->where('gl_domain_info.amp_status',$this->map['amp_status']); | 270 | $query = $query->where('gl_domain_info.amp_status',$this->map['amp_status']); |
| 267 | } | 271 | } |
| @@ -61,6 +61,7 @@ class ProjectController extends BaseController | @@ -61,6 +61,7 @@ class ProjectController extends BaseController | ||
| 61 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | 61 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') |
| 62 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id') | 62 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id') |
| 63 | ->leftJoin('gl_web_setting_template', 'gl_project.id', '=', 'gl_web_setting_template.project_id') | 63 | ->leftJoin('gl_web_setting_template', 'gl_project.id', '=', 'gl_web_setting_template.project_id') |
| 64 | + ->leftJoin('gl_project_association', 'gl_project.id', '=', 'gl_project_association.project_id') | ||
| 64 | ->where('gl_project.delete_status',Project::TYPE_ZERO); | 65 | ->where('gl_project.delete_status',Project::TYPE_ZERO); |
| 65 | $query = $this->searchParam($query); | 66 | $query = $this->searchParam($query); |
| 66 | $query = $this->orderByList($query); | 67 | $query = $this->orderByList($query); |
| @@ -122,6 +123,7 @@ class ProjectController extends BaseController | @@ -122,6 +123,7 @@ class ProjectController extends BaseController | ||
| 122 | 'gl_project_deploy_optimize.design_mid AS design_mid', | 123 | 'gl_project_deploy_optimize.design_mid AS design_mid', |
| 123 | 'gl_project_deploy_optimize.api_no AS api_no', | 124 | 'gl_project_deploy_optimize.api_no AS api_no', |
| 124 | 'gl_web_setting_template.template_id AS template_id', | 125 | 'gl_web_setting_template.template_id AS template_id', |
| 126 | + 'gl_project_association.friend_id as friend_id', | ||
| 125 | ]; | 127 | ]; |
| 126 | return $select; | 128 | return $select; |
| 127 | } | 129 | } |
| @@ -172,7 +174,7 @@ class ProjectController extends BaseController | @@ -172,7 +174,7 @@ class ProjectController extends BaseController | ||
| 172 | */ | 174 | */ |
| 173 | public function searchType(&$query){ | 175 | public function searchType(&$query){ |
| 174 | if(isset($this->map['type'])){ | 176 | if(isset($this->map['type'])){ |
| 175 | - $query->where('gl_project.extend_type', '!=' ,5); | 177 | + $query->where('gl_project.extend_type', '!=' ,5)->where('gl_project.extend_type', '!=' ,8); |
| 176 | if (in_array($this->map['type'], [Project::TYPE_ZERO, Project::TYPE_ONE, Project::TYPE_TWO, Project::TYPE_THREE])){ | 178 | if (in_array($this->map['type'], [Project::TYPE_ZERO, Project::TYPE_ONE, Project::TYPE_TWO, Project::TYPE_THREE])){ |
| 177 | $query->where('gl_project.type', $this->map['type']); | 179 | $query->where('gl_project.type', $this->map['type']); |
| 178 | } elseif ($this->map['type'] == 8){ | 180 | } elseif ($this->map['type'] == 8){ |
| @@ -295,6 +297,16 @@ class ProjectController extends BaseController | @@ -295,6 +297,16 @@ class ProjectController extends BaseController | ||
| 295 | if(isset($this->map['plan'])){ | 297 | if(isset($this->map['plan'])){ |
| 296 | $query = $query->where('gl_project_deploy_build.plan',$this->map['plan']); | 298 | $query = $query->where('gl_project_deploy_build.plan',$this->map['plan']); |
| 297 | } | 299 | } |
| 300 | + if(isset($this->map['friend_id'])){ | ||
| 301 | + if($this->map['friend_id'] == 1){ | ||
| 302 | + $query = $query->where('gl_project_association.friend_id', '!=', 0); | ||
| 303 | + }else{ | ||
| 304 | + $query = $query->where(function ($subQuery) { | ||
| 305 | + $subQuery->where('gl_project_association.friend_id', 0) | ||
| 306 | + ->orWhereNull('gl_project_association.friend_id'); | ||
| 307 | + }); | ||
| 308 | + } | ||
| 309 | + } | ||
| 298 | if(isset($this->map['seo_plan'])){ | 310 | if(isset($this->map['seo_plan'])){ |
| 299 | $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); | 311 | $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); |
| 300 | } | 312 | } |
| @@ -210,7 +210,7 @@ class CNoticeController extends BaseController | @@ -210,7 +210,7 @@ class CNoticeController extends BaseController | ||
| 210 | * 更新通知C端 | 210 | * 更新通知C端 |
| 211 | * @param Request $request | 211 | * @param Request $request |
| 212 | * @return \Illuminate\Http\JsonResponse | 212 | * @return \Illuminate\Http\JsonResponse |
| 213 | - * @param : type : 1->主站更新 4->聚合页更新 | 213 | + * @param : type : 1->主站更新 4->聚合页更新 7->ai博客 |
| 214 | */ | 214 | */ |
| 215 | public function sendNotify(Request $request) | 215 | public function sendNotify(Request $request) |
| 216 | { | 216 | { |
| @@ -301,8 +301,11 @@ class CNoticeController extends BaseController | @@ -301,8 +301,11 @@ class CNoticeController extends BaseController | ||
| 301 | 'language'=> $language, | 301 | 'language'=> $language, |
| 302 | 'is_sitemap' => $is_sitemap | 302 | 'is_sitemap' => $is_sitemap |
| 303 | ]; | 303 | ]; |
| 304 | -// http_post($c_url, json_encode($c_param)); | ||
| 305 | - NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$c_url,'c_params'=>$c_param])); | 304 | + try { |
| 305 | + http_post($c_url, json_encode($c_param)); | ||
| 306 | + }catch (\Exception $e){ | ||
| 307 | + NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$c_url,'c_params'=>$c_param])); | ||
| 308 | + } | ||
| 306 | } | 309 | } |
| 307 | $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); | 310 | $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!'); |
| 308 | } | 311 | } |
| @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController | @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController | ||
| 93 | if($info === false){ | 93 | if($info === false){ |
| 94 | $info = []; | 94 | $info = []; |
| 95 | }else{ | 95 | }else{ |
| 96 | - $date_time = strtotime($info['updated_at']) + 120; | 96 | + $date_time = strtotime($info['updated_at']) + 60; |
| 97 | if($date_time < time()){ | 97 | if($date_time < time()){ |
| 98 | $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); | 98 | $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); |
| 99 | $info['status'] = 0; | 99 | $info['status'] = 0; |
| @@ -359,7 +359,7 @@ class ProductController extends BaseController | @@ -359,7 +359,7 @@ class ProductController extends BaseController | ||
| 359 | } | 359 | } |
| 360 | if (!empty($new_content)){ | 360 | if (!empty($new_content)){ |
| 361 | $detailModel = new Detail(); | 361 | $detailModel = new Detail(); |
| 362 | - $detailInfo = $detailModel->read(['column_id'=>1]); | 362 | + $detailInfo = $detailModel->read(['column_id'=>1,'product_id'=>$this->param['product_id']]); |
| 363 | if($detailInfo !== false && !empty($detailInfo['content'])){ | 363 | if($detailInfo !== false && !empty($detailInfo['content'])){ |
| 364 | $productInfo['content'] = $new_content . $detailInfo['content']['content']; | 364 | $productInfo['content'] = $new_content . $detailInfo['content']['content']; |
| 365 | } | 365 | } |
| @@ -70,7 +70,7 @@ class LoginLogic extends BaseLogic | @@ -70,7 +70,7 @@ class LoginLogic extends BaseLogic | ||
| 70 | // Cache::pull(Common::MANAGE_TOKEN . $manage['token']); | 70 | // Cache::pull(Common::MANAGE_TOKEN . $manage['token']); |
| 71 | // } | 71 | // } |
| 72 | //生成新token | 72 | //生成新token |
| 73 | - $token = md5(uniqid().$manage['id']); | 73 | + $token = $manage['id'].'_a'.md5(uniqid().$manage['id']); |
| 74 | unset($manage['password']); | 74 | unset($manage['password']); |
| 75 | //更新用户信息 | 75 | //更新用户信息 |
| 76 | $manage->token = $token; | 76 | $manage->token = $token; |
| @@ -90,7 +90,7 @@ class UserLoginLogic | @@ -90,7 +90,7 @@ class UserLoginLogic | ||
| 90 | Cache::pull($info['token']); | 90 | Cache::pull($info['token']); |
| 91 | } | 91 | } |
| 92 | //生成新token | 92 | //生成新token |
| 93 | - $token = md5(uniqid().$info['id']); | 93 | + $token = $info['id'].'_b'.md5(uniqid().$info['id']); |
| 94 | //存储缓存 | 94 | //存储缓存 |
| 95 | $info['token'] = $token; | 95 | $info['token'] = $token; |
| 96 | Cache::add($token,$info,3600 * 12); | 96 | Cache::add($token,$info,3600 * 12); |
-
请 注册 或 登录 后发表评论