作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

... ... @@ -312,7 +312,7 @@ class ProjectUpdate extends Command
}
//关联分类
if($category_arr){
if ($category_arr) {
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
}
... ... @@ -689,7 +689,7 @@ class ProjectUpdate extends Command
$host = $arr['host'] ?? '';
$path = $arr['path'] ?? '';
$url_complete = ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path;
$url_complete = ($scheme ?: 'https') . '://' . $domain . $path;
if (
(empty($scheme) || $scheme == 'https' || $scheme == 'http')
... ...
... ... @@ -54,12 +54,13 @@ class UpdateRoute extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['id'=>['in',[68]],'is_upgrade'=>0]);
$list = $projectModel->list(['id'=>['in',[627]]]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->getProduct();
// $this->getProduct();
// $this->setProductKeyword();
$this->getRouteMap();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -138,7 +139,22 @@ class UpdateRoute extends Command
}
}
/**
* @remark :升级项目同步路由
* @name :getRouteMap
* @author :lyh
* @method :post
* @time :2024/1/4 11:53
*/
public function getRouteMap(){
$routeMapModel = new RouteMap();
$list = $routeMapModel->list(['source'=>'product','project_id'=>627]);
foreach ($list as $k => $v){
$product = new Product();
$product->edit(['route'=>$v['route']],['id'=>$v['source_id']]);
echo date('Y-m-d H:i:s') . '产品id:'.$v['source_id'] . PHP_EOL;
}
}
/**
* @remark :删除路由通知C端
... ... @@ -154,4 +170,6 @@ class UpdateRoute extends Command
curlGet($url);
return true;
}
}
... ...
... ... @@ -65,7 +65,7 @@ if (!function_exists('http_post')) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
... ... @@ -74,6 +74,8 @@ if (!function_exists('http_post')) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
if (curl_errno($ch)) {
$error_message = curl_error($ch);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($error_message, true) . PHP_EOL, FILE_APPEND);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
}
curl_close($ch);
... ...
... ... @@ -87,14 +87,14 @@ class ProjectLogic extends BaseLogic
$info['deploy_build']['other_project']= json_decode($info['deploy_build']['other_project']);
}
//升级项目采集完成时间
// $collect_time = '';
// if($info['is_upgrade'] == 1){
// $collect_info = UpdateLog::where('project_id',$id)->where('api_type','blog')->first();
// if($collect_info){
// $collect_time = $collect_info->collect_status == 0 ? '采集中' : $collect_info->updated_at->format('Y-m-d H:i:s');
// }
// }
// $info['collect_time'] = $collect_time;
$collect_time = '';
if($info['is_upgrade'] == 1){
$collect_info = UpdateLog::where('project_id',$id)->where('api_type','blog')->first();
if($collect_info){
$collect_time = $collect_info->collect_status == 0 ? '采集中' : $collect_info->updated_at->format('Y-m-d H:i:s');
}
}
$info['collect_time'] = $collect_time;
return $this->success($info);
}
... ...
... ... @@ -604,10 +604,6 @@ class BTemplateLogic extends BaseLogic
$param['head_css'] = characterTruncation($param['html'],'/<style id="globalsojs-header">(.*?)<\/style>/s');
$param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s');
$param['footer_css'] = characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s');
if(!isset($param['is_custom'])){
$param['is_custom'] = BTemplate::IS_NO_CUSTOM;
}
$param['type'] = BTemplate::PAGE_HTML;//不显示整个HTML
return $this->success($param);
}
... ...