作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -79,22 +79,22 @@ class RemainDay extends Command @@ -79,22 +79,22 @@ class RemainDay extends Command
79 $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - floor($diff / (60 * 60 * 24)); 79 $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - floor($diff / (60 * 60 * 24));
80 }else{ 80 }else{
81 if($item['type'] == Project::TYPE_TWO){ 81 if($item['type'] == Project::TYPE_TWO){
82 - $compliance_day = $item->finish_remain_day ?? 0;  
83 - if($compliance_day == 0){  
84 - $item->pause_days = 0; 82 + $compliance_day = ($item->finish_remain_day ?? 0);
  83 + if($item->finish_remain_day < $item->pause_days){
  84 + $item->pause_days = $item->finish_remain_day;
85 } 85 }
86 $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - $compliance_day; 86 $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - $compliance_day;
87 }else{ 87 }else{
88 if($item->uptime){ 88 if($item->uptime){
89 $diff = time() - strtotime($item->uptime); 89 $diff = time() - strtotime($item->uptime);
90 $item->finish_remain_day = floor($diff / (60 * 60 * 24)); 90 $item->finish_remain_day = floor($diff / (60 * 60 * 24));
91 - $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - floor($diff / (60 * 60 * 24)); 91 + $remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24));
92 }else{ 92 }else{
93 $remain_day = $item['deploy_build']['service_duration']; 93 $remain_day = $item['deploy_build']['service_duration'];
94 } 94 }
95 } 95 }
96 } 96 }
97 - $item->remain_day = $remain_day > 0 ? $remain_day : 0; 97 + $item->remain_day = ($remain_day > 0 ? $remain_day : 0);
98 if($item->remain_day == 0){ 98 if($item->remain_day == 0){
99 $item->extend_type = Project::TYPE_FIVE; 99 $item->extend_type = Project::TYPE_FIVE;
100 $item->site_status = Project::TYPE_ONE;//关闭站点 100 $item->site_status = Project::TYPE_ONE;//关闭站点
@@ -380,7 +380,7 @@ class UpdateSeoTdk extends Command @@ -380,7 +380,7 @@ class UpdateSeoTdk extends Command
380 $projectKeywordModel = new ProjectKeyword(); 380 $projectKeywordModel = new ProjectKeyword();
381 $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); 381 $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]);
382 $info['main_keyword'] = ''; 382 $info['main_keyword'] = '';
383 - if($keywordInfo === false){ 383 + if(!empty($keywordInfo['main_keyword'])){
384 $info['main_keyword'] = $keywordInfo['main_keyword']; 384 $info['main_keyword'] = $keywordInfo['main_keyword'];
385 } 385 }
386 Cache::put($cache_key, $info, 600); 386 Cache::put($cache_key, $info, 600);
@@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel @@ -20,7 +20,7 @@ class Kernel extends ConsoleKernel
20 $schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块 20 $schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块
21 $schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块 21 $schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块
22 // $schedule->command('inspire')->hourly(); 22 // $schedule->command('inspire')->hourly();
23 - $schedule->command('remain_day')->dailyAt('08:30')->withoutOverlapping(1); // 项目剩余服务时长 23 + $schedule->command('remain_day')->dailyAt('09:30')->withoutOverlapping(1); // 项目剩余服务时长
24 $schedule->command('rank_data_task')->everyMinute()->withoutOverlapping(1); // 排名数据更新任务 24 $schedule->command('rank_data_task')->everyMinute()->withoutOverlapping(1); // 排名数据更新任务
25 $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次 25 $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次
26 $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 26 $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流
@@ -196,7 +196,7 @@ class PrivateController extends BaseController @@ -196,7 +196,7 @@ class PrivateController extends BaseController
196 return $this->error('未找到当前域名对应的项目!'); 196 return $this->error('未找到当前域名对应的项目!');
197 } 197 }
198 ProjectServer::useProject($project->id); 198 ProjectServer::useProject($project->id);
199 - $feature_category = Category::whereIn('title', ['Featured','featured'])->pluck('id'); 199 + $feature_category = Category::whereIn('title', ['Featured','featured', 'Featured Products'])->pluck('id');
200 $feature_product = CategoryRelated::whereIn('cate_id',$feature_category)->pluck('product_id')->unique()->toArray(); 200 $feature_product = CategoryRelated::whereIn('cate_id',$feature_category)->pluck('product_id')->unique()->toArray();
201 $product_route = Product::where(['status' => Product::STATUS_ON])->whereNotIn('id', $feature_product)->pluck('route')->toArray(); 201 $product_route = Product::where(['status' => Product::STATUS_ON])->whereNotIn('id', $feature_product)->pluck('route')->toArray();
202 return $this->success($product_route); 202 return $this->success($product_route);
@@ -67,6 +67,16 @@ class ExtensionModuleController extends BaseController @@ -67,6 +67,16 @@ class ExtensionModuleController extends BaseController
67 ]); 67 ]);
68 $moduleFieldModel = new ExtensionModuleField(); 68 $moduleFieldModel = new ExtensionModuleField();
69 $list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']]); 69 $list = $moduleFieldModel->list(['module_id'=>$this->param['module_id']]);
  70 + $moduleValueModel = new ExtensionModuleValue();
  71 + foreach ($list as $k => $v){
  72 + $v['is_use'] = 0;
  73 + //查看当前字段是否已使用
  74 + $info = $moduleValueModel->read(['field_id'=>$v['id']],['id']);
  75 + if($info !== false){
  76 + $v['is_use'] = 1;
  77 + }
  78 + $list[$k] = $v;
  79 + }
70 $this->response('success',Code::SUCCESS,$list); 80 $this->response('success',Code::SUCCESS,$list);
71 } 81 }
72 82
@@ -131,7 +141,12 @@ class ExtensionModuleController extends BaseController @@ -131,7 +141,12 @@ class ExtensionModuleController extends BaseController
131 $data[$v['uuid']][$v['field_id']] = $v['value']; 141 $data[$v['uuid']][$v['field_id']] = $v['value'];
132 } 142 }
133 } 143 }
134 - $this->response('success',Code::SUCCESS,$data); 144 + $resultData = [];
  145 + foreach ($data as $k => $v){
  146 + $v['uuid'] = $k;
  147 + $resultData[] = $v;
  148 + }
  149 + $this->response('success',Code::SUCCESS,$resultData);
135 } 150 }
136 151
137 /** 152 /**
@@ -198,6 +213,18 @@ class ExtensionModuleController extends BaseController @@ -198,6 +213,18 @@ class ExtensionModuleController extends BaseController
198 ]; 213 ];
199 $moduleValueModel->addReturnId($data); 214 $moduleValueModel->addReturnId($data);
200 } 215 }
201 - $this->response('success',Code::SUCCESS,['uuid'=>$this->param['uuid']]); 216 + $this->response('success',Code::SUCCESS,['uuid'=>$uuid]);
  217 + }
  218 +
  219 + /**
  220 + * @remark :生成唯一的字符串
  221 + * @name :sendUniqueStr
  222 + * @author :lyh
  223 + * @method :post
  224 + * @time :2024/8/20 10:31
  225 + */
  226 + public function sendUniqueStr(){
  227 + $uniqueString = md5(time() . rand(1000, 9999));
  228 + $this->response('success',Code::SUCCESS,['str'=>$uniqueString]);
202 } 229 }
203 } 230 }
@@ -403,7 +403,7 @@ class ProductLogic extends BaseLogic @@ -403,7 +403,7 @@ class ProductLogic extends BaseLogic
403 $cateList = $cateModel->list($status,'id',['id','pid']); 403 $cateList = $cateModel->list($status,'id',['id','pid']);
404 $this->param['featured_status'] = $this->param['featured_status'] ?? 0; 404 $this->param['featured_status'] = $this->param['featured_status'] ?? 0;
405 if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){ 405 if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){
406 - $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); 406 + $featured_ids = $cateModel->where('title', 'Featured')->pluck('id')->toArray();
407 //获取当前的子集 407 //获取当前的子集
408 $featured_arr = []; 408 $featured_arr = [];
409 foreach ($featured_ids as $id){ 409 foreach ($featured_ids as $id){
@@ -95,6 +95,18 @@ class RankDataLogic extends BaseLogic @@ -95,6 +95,18 @@ class RankDataLogic extends BaseLogic
95 $languageList = $languageModel->list(['project_id'=>$project['id']]); 95 $languageList = $languageModel->list(['project_id'=>$project['id']]);
96 if(!empty($languageList) && is_array($languageList)){ 96 if(!empty($languageList) && is_array($languageList)){
97 foreach($languageList as $lang){ 97 foreach($languageList as $lang){
  98 + if($lang['lang'] =='ja'){
  99 + $lang['lang'] ='jp';
  100 + }
  101 + if($lang['lang'] == 'ko'){
  102 + $lang['lang'] ='kr';
  103 + }
  104 + if($lang['lang'] =='ms'){
  105 + $lang['lang']='my';
  106 + }
  107 + if($lang['lang'] == 'vi'){
  108 + $lang['lang'] ='vn';
  109 + }
98 $remain_day = $lang_data[$lang['lang']]['dabiao_day'] ?? 0; 110 $remain_day = $lang_data[$lang['lang']]['dabiao_day'] ?? 0;
99 $data['langs'][$lang['language'] ?? ''] = [ 111 $data['langs'][$lang['language'] ?? ''] = [
100 'lang'=>$lang['lang'], 112 'lang'=>$lang['lang'],
@@ -390,6 +402,18 @@ class RankDataLogic extends BaseLogic @@ -390,6 +402,18 @@ class RankDataLogic extends BaseLogic
390 $lang_list = $api->getLangList(); 402 $lang_list = $api->getLangList();
391 if (!empty($lang_list[$api_no])) { 403 if (!empty($lang_list[$api_no])) {
392 foreach ($lang_list[$api_no] as $lang){ 404 foreach ($lang_list[$api_no] as $lang){
  405 + if($lang =='ja'){
  406 + $lang ='jp';
  407 + }
  408 + if($lang == 'ko'){
  409 + $lang ='kr';
  410 + }
  411 + if($lang =='ms'){
  412 + $lang='my';
  413 + }
  414 + if($lang == 'vi'){
  415 + $lang ='vn';
  416 + }
393 $model = RankData::where('project_id', $project_id)->where('lang', $lang)->first(); 417 $model = RankData::where('project_id', $project_id)->where('lang', $lang)->first();
394 if (!$model || $model->updated_date != date('Y-m-d') || $force) { 418 if (!$model || $model->updated_date != date('Y-m-d') || $force) {
395 $res = $api->getGoogleRank($api_no, $lang, 7, $force); 419 $res = $api->getGoogleRank($api_no, $lang, 7, $force);
@@ -577,6 +577,7 @@ Route::middleware(['bloginauth'])->group(function () { @@ -577,6 +577,7 @@ Route::middleware(['bloginauth'])->group(function () {
577 Route::any('/getModuleValueList', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'getModuleValueList'])->name('extension_module_getModuleValueList'); 577 Route::any('/getModuleValueList', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'getModuleValueList'])->name('extension_module_getModuleValueList');
578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue'); 578 Route::any('/addModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'addModuleValue'])->name('extension_module_addModuleValue');
579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue'); 579 Route::any('/editModuleValue', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'editModuleValue'])->name('extension_module_editModuleValue');
  580 + Route::any('/sendUniqueStr', [\App\Http\Controllers\Bside\ExtensionModule\ExtensionModuleController::class, 'sendUniqueStr'])->name('extension_module_sendUniqueStr');
580 }); 581 });
581 582
582 //自定义小语种文本信息 583 //自定义小语种文本信息