作者 张关杰

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

... ... @@ -273,7 +273,7 @@ class VideoTask extends Command
if (strpos(','.$keyword_id.',', ','.$productKeyword->id.',') === false) {
//不包含
$productModel = new Product();
$keyword_id = $keyword_id . $productKeyword->id.',';
$keyword_id = ','.$keyword_id.',' . $productKeyword->id.',';
$productModel->edit(['keyword_id'=>$keyword_id],['id'=>$item->id]);
}
$data[] = ['url'=>getImageUrl($item->thumb['url']),'title'=>$item->title];
... ...
... ... @@ -59,8 +59,8 @@ class KeywordVideoController extends BaseController
* @time :2023/8/18 10:58
*/
public function searchParam(&$query){
if(isset($this->map['project_name']) && is_array($this->map['project_name'])){
$query->where('gl_project.title','like','%'.$this->map['project_name'].'%');
if(isset($this->map['title']) && is_array($this->map['title'])){
$query->where('gl_project.title','like','%'.$this->map['title'].'%');
}
if(isset($this->map['status'])){
$query->where('gl_keyword_video_task.status',$this->map['status']);
... ...
... ... @@ -13,9 +13,12 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\HomeCount\Count;
use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryIP;
use App\Models\Inquiry\InquirySet;
use App\Models\News\News;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Visit\Visit;
use Carbon\Carbon;
class MonthReportController extends BaseController
... ... @@ -82,6 +85,9 @@ class MonthReportController extends BaseController
$info['news_num_last_7'] = $newsModel->formatQuery(
['status'=>0,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
])->count();
$info['service_duration'] = $this->user['service_duration'];//服务天数
$info['ip_total'] = (new Visit())->count();//ip总数
$info['remain_day'] = $this->user['remain_day'];//剩余服务天数
$info['speed'] = round((0.3 + mt_rand()/mt_getrandmax() * (1-0.3)),2);
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -41,6 +41,9 @@ class BaseController extends Controller
$this->uid = $info['id'];
//参数处理
$this->getParam();
if(!empty($this->user)){
$this->project = Cache::get('user-'.$this->user['project_id']);
}
//日志记录
$this->set_user_log();
}
... ...
... ... @@ -305,13 +305,13 @@ class DomainInfoLogic extends BaseLogic
];
$this->model->edit($data,['id'=>$this->param['id']]);
//主站生成证书
EditDomainBt::dispatch($this->param['id']);
// $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
// EditDomainBt::dispatch($this->param['id']);
$this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
//amp站生成证书
if($data['amp_status']){
EditAmpDomainBt::dispatch($this->param['id']);
// $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']);
// EditAmpDomainBt::dispatch($this->param['id']);
$this->setAmpDomainSsl($server_info['init_domain'],$info['domain']);
}
return $this->success();
... ...
... ... @@ -158,7 +158,6 @@ class ProjectLogic extends BaseLogic
$this->saveProjectAfter($this->param['project_after']);
$this->saveMinorLanguages($this->param['minor_language'] ?? []);
$this->syncImageFile($this->param['project_location'],$this->param['id']);
//创建站点
(new SyncService())->projectAcceptAddress($this->param['id']);
}
DB::commit();
... ... @@ -288,7 +287,8 @@ class ProjectLogic extends BaseLogic
//更改域名
$this->editDomainStatus($deploy_optimize['domain'],$deploy_optimize['project_id']);
}
$deploy_optimize['minor_languages'] = Arr::a2s( []);
$deploy_optimize['minor_languages'] = Arr::a2s($deploy_optimize['minor_languages'] ?? []);
$deploy_optimize['g_top_plan'] = Arr::a2s($deploy_optimize['g_top_plan'] ?? []);
$deploy_optimize['minor_keywords'] = Arr::a2s(!empty($deploy_optimize['minor_keywords']) ? $deploy_optimize['minor_keywords'] : []);
$deploy_optimize['special'] = !empty($deploy_optimize['special']) ? ','.trim($deploy_optimize['special'],',').',' : '';
//是否更新了api_no
... ...
... ... @@ -173,6 +173,8 @@ class UserLoginLogic
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['project_type'] = $project['type'];
$info['service_duration'] = $project['deploy_build']['service_duration'];
$info['remain_day'] = $project['remain_day'];
if($info['is_customized'] == 1){
$info['is_visualization'] = json_decode($project['is_visualization']);
}
... ... @@ -272,6 +274,8 @@ class UserLoginLogic
$info['project_type'] = $project['type'];
$info['storage_type'] = $project['storage_type'];
$info['project_location'] = $project['project_location'];
$info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0;
$info['remain_day'] = $project['remain_day'] ?? 0;
if($info['is_customized'] == 1){
$info['is_visualization'] = json_decode($project['is_visualization']);
}
... ...
... ... @@ -58,6 +58,7 @@ class CopyProjectJob implements ShouldQueue
$type = $data['type'];
$data['type'] = 0;
$data['status'] = 0;
$data['finish_remain_day'] = 0;
$data['title'] = $data['title'].'-copy';
unset($data['id']);
$project_id = $projectModel->insertGetId($data);
... ... @@ -82,6 +83,8 @@ class CopyProjectJob implements ShouldQueue
$optimizeData = $optimizeData->getAttributes();
unset($optimizeData['id'],$optimizeData['domain']);
$optimizeData['project_id'] = $project_id;
$optimizeData['api_no'] = 0;
$optimizeData['minor_languages'] = json_encode([]);
$optimizeModel->insert($optimizeData);
}
//复制付费表
... ... @@ -160,6 +163,9 @@ class CopyProjectJob implements ShouldQueue
$sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']);
}
if($table == 'gl_customer_visit' || $table == 'gl_customer_visit_item' || $table == 'gl_inquiry_other' || $table == 'gl_inquiry_form_data' || $table == 'gl_inquiry_form'){
continue;
}
// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
DB::connection('custom_mysql')->table($table)->insertUsing(
[], // 列名数组,留空表示插入所有列
... ...
... ... @@ -38,27 +38,25 @@ class EditCustomDomainBt implements ShouldQueue
*/
public function handle()
{
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书---开始', true) . PHP_EOL, FILE_APPEND);
//获取域名数据
$domain_model = new CountryCustom();
$domain_info = $domain_model->read(['id' => $this->domain_id]);
if ($domain_info === false) {
return $this->output($domain_info['custom_domain'] . ':获取域名数据失败');
}
//获取项目数据
$project_model = new Project();
$project_info = $project_model->read(['id' => $domain_info['project_id']], 'serve_id');
if ($project_info === false) {
return $this->output($domain_info['custom_domain'] . ':获取项目数据失败');
}
//获取服务器数据
$server_model = new ServerConfig();
$server_info = $server_model->read(['id' => $project_info['serve_id']], ['init_domain', 'host']);
if ($server_info === false) {
return $this->output($domain_info['custom_domain'] . ':获取服务器数据失败');
}
//编辑站点
if ($domain_info['type'] == 2) {
$api_url = 'http://' . $server_info['init_domain'] . '/api/setSsl';
... ... @@ -70,6 +68,7 @@ class EditCustomDomainBt implements ShouldQueue
'other_domain' => [],
'is_https' => 1
];
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
} else {
$api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl';
$api_param = [
... ... @@ -78,9 +77,11 @@ class EditCustomDomainBt implements ShouldQueue
'other_domain' => [],
'is_https' => 1
];
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
}
try {
$rs = HttpUtils::get($api_url, $api_param);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('请求接口返回数据:'.$rs, true) . PHP_EOL, FILE_APPEND);
$rs = json_decode($rs, true);
if (isset($rs['status']) && $rs['status'] == 200) {
$this->output($domain_info['custom_domain'] . ':站点编辑成功');
... ... @@ -88,6 +89,7 @@ class EditCustomDomainBt implements ShouldQueue
$this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? ''));
}
} catch (\Exception | GuzzleException $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('错误情况打印:'.$rs, true) . PHP_EOL, FILE_APPEND);
$this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage());
}
... ...
... ... @@ -19,7 +19,9 @@ class DeployOptimize extends Base
public function getMinorLanguagesAttribute($value){
return Arr::s2a($value);
}
public function getGTopPlanAttribute($value){
return Arr::s2a($value);
}
public static function clearCache($row){
$cache_key = 'project_' . $row->original['domain'];
Cache::forget($cache_key);
... ...
... ... @@ -170,7 +170,7 @@ class ProjectServer
* @method :post
* @time :2023/12/29 9:32
*/
public function init404Page($project_id){
public static function init404Page($project_id){
$time = date('Y-m-d H:i:s');
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
if(empty($info)) {
... ...