作者 张关杰

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

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