作者 刘锟

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

... ... @@ -27,7 +27,7 @@ class RemainDay extends Command
* @var 按优化时间统计
*/
protected $projectId = [
1434,1812,276,2414,2974,793
1434,1812,276,2414,2974,
];//需要单独处理的项目
/**
... ... @@ -37,7 +37,13 @@ class RemainDay extends Command
protected $bm_projectId = [
4247,4299,4310,4215,4038,4084,4148,4178,4405
];
/**
* @var
* 优化项目,中途切换按服务时间长计时,单独计算
*/
protected $projectSwitchId = [
793,
];
/**
* @var 暂停的项目
... ... @@ -85,8 +91,8 @@ class RemainDay extends Command
public function saveRemainDay(){
$list = $this->project->list(['extend_type'=>Project::TYPE_ZERO,'type'=>['in',[Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR,Project::TYPE_SIX]]],'id',['id','type','level','uptime','remain_day','is_remain_today','pause_days','finish_remain_day','bm_finish_remain_day']);
foreach ($list as $item){
$deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);
echo 'start->项目id:' . $item['id'] . '执行时间:'. date('Y-m-d H:i:s') . PHP_EOL;
$deploy_build = $this->deployBuild->read(['project_id'=>$item['id']],['service_duration','seo_service_duration','plan','seo_plan']);
if(in_array($item['id'],$this->ceaseProjectId)){//暂停的项目
if(($item['type'] == Project::TYPE_TWO) && ($item['is_remain_today'] == 1)){
$pause_days = $item['pause_days'] + 1;
... ... @@ -97,6 +103,11 @@ class RemainDay extends Command
$this->project->edit(['pause_days'=>$pause_days],['id'=>$item['id']]);
continue;
}
//todo::优化项目中途达标计时切换为按天计时
if(in_array($item['id'],$this->projectSwitchId)){
$this->project->edit(['remain_day'=>$item['remain_day'] - 1,'finish_remain_day'=>$item['finish_remain_day'] + 1],['id'=>$item['id']]);
continue;
}
//白帽版本单独计算
$this->seoRemainDay($deploy_build,$item);
//默认版本统计
... ...
... ... @@ -53,24 +53,28 @@ class SendProduct extends Command
if(empty($domain)){
continue;
}
$arr1 = $this->sendProduct();
$arr2 = $this->sendBlog();
$arr3 = $this->sendNews();
$url = array_merge((array)$arr1,(array)$arr2,(array)$arr3);
if(!empty($url)){
$c_url = $domain.'api/update_page/';
$param = [
'project_id' => $v['id'],
'type' => 1,
'route' => 3,
'url' => $url,
'language'=> [],
'is_sitemap' => 0
];
http_post($c_url, json_encode($param));
try {
$arr1 = $this->sendProduct();
$arr2 = $this->sendBlog();
$arr3 = $this->sendNews();
$url = array_merge((array)$arr1,(array)$arr2,(array)$arr3);
if(!empty($url)){
$c_url = $domain.'api/update_page/';
$param = [
'project_id' => $v['id'],
'type' => 1,
'route' => 3,
'url' => $url,
'language'=> [],
'is_sitemap' => 0
];
//TODO::通知C端生成界面
http_post($c_url, json_encode($param));
}
}catch (\Exception $e){
DB::disconnect('custom_mysql');
continue;
}
//TODO::通知C端生成界面
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ... @@ -83,7 +87,6 @@ class SendProduct extends Command
* @time :2024/8/30 14:44
*/
public function sendProduct(){
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$productModel = new Product();
$arr = $productModel->formatQuery(['send_time'=>['<=',$end_date],'status'=>3])->pluck('route')->toArray();
... ... @@ -99,7 +102,6 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendBlog(){
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$blogModel = new Blog();
$arr = $blogModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray();
... ... @@ -115,7 +117,6 @@ class SendProduct extends Command
* @time :2024/8/30 15:19
*/
public function sendNews(){
$start_date = date('Y-m-d 00:00:00');
$end_date = date('Y-m-d 23:59:59');
$newsModel = new News();
$arr = $newsModel->formatQuery(['release_at'=>['<=',$end_date],'status'=>3])->pluck('url')->toArray();
... ...
... ... @@ -31,13 +31,15 @@ class GeoController extends BaseController
try {
$token = trim($this->param['token']);
$param = Crypt::decrypt($token);
if ($param['send_at'] + 86400 < time()) {}
$project_id = $param['project_id'];
} catch (\Exception $e) {
return $this->error('非法请求');
}catch (\Exception $e){
$this->response('非法请求',Code::SYSTEM_ERROR);
}
if ($param['send_at'] + 86400 < time()) {
$this->response('非法请求,已过期',Code::SYSTEM_ERROR);
}
$project_id = $param['project_id'];
$projectModel = new Project();
$projectInfo = $projectModel->read(['project_id' => $project_id],['title','version']);
$projectInfo = $projectModel->read(['id' => $project_id],['title','version']);
$geoWritingsModel = new GeoWritings();
$lists = $geoWritingsModel->list(['project_id' => $project_id, 'status' => 2 ,'is_del' => GeoWritings::IS_DEL_FALSE],'id',['title', 'status', 'uniqid', 'confirm_at']);
$result = [
... ... @@ -93,7 +95,7 @@ class GeoController extends BaseController
$this->param['content_length'] = strlen($this->param['content']);
$this->param['status'] = GeoWritings::STATUS_FINISH;
$geoWritingsModel->edit($this->param,['uniqid' => $token]);
return true;
$this->response('success',Code::SUCCESS);
}
/**
... ... @@ -134,6 +136,8 @@ class GeoController extends BaseController
]);
$geoConfirmModel = new GeoConfirm();
$this->param['status'] = $geoConfirmModel::STATUS_FINISH;
$this->param['confirm_ip'] = $this->request->ip();
$this->param['confirm_at'] = date('Y-m-d H:i:s');
$result = $geoConfirmModel->edit($this->param,['uniqid'=>$this->param['uniqid']]);
$this->response('success',Code::SUCCESS,$result);
}
... ...
<?php
/**
* @remark :
* @name :SettingFaqController.php
* @author :lyh
* @method :post
* @time :2025/10/29 16:32
*/
namespace App\Http\Controllers\Bside\Setting;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Setting\SettingFaqLogic;
use Illuminate\Http\Request;
class SettingFaqController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new SettingFaqLogic();
}
/**
* @remark :faq列表页数据
* @name :lists
* @author :lyh
* @method :post
* @time :2025/10/29 16:38
*/
public function lists()
{
$lists = $this->logic->getFaqLists($this->map,$this->page,$this->row,$this->order);
$this->response('success',Code::SUCCESS,$lists);
}
}
... ...
... ... @@ -44,7 +44,7 @@ class GeoConfirmLogic extends BaseLogic
if($info === false){
$id = $this->model->addReturnId($param);
}else{
$id = $param['id'];
$id = $info['id'];
$this->model->edit($param,['id'=>$info['id']]);
}
$friend = ProjectAssociation::where(['project_id' => $param['project_id']])->first();
... ...
<?php
/**
* @remark :
* @name :SettingFaqLogic.php
* @author :lyh
* @method :post
* @time :2025/10/29 16:34
*/
namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\WebSetting\SettingFaq;
class SettingFaqLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new SettingFaq();
$this->param = $this->requestAll;
}
/**
* @remark :获取列表页数据
* @name :getFaqLists
* @author :lyh
* @method :post
* @time :2025/10/29 16:50
*/
public function getFaqLists($map = [],$page = 1, $row = 10,$order = 'id')
{
$lists = $this->model->lists($map,$page,$row,$order);
return $this->success($lists);
}
/**
* @remark :保存数据
* @name :saveFaq
* @author :lyh
* @method :post
* @time :2025/10/29 16:50
*/
public function saveFaq()
{
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
}else{
$id = $this->model->addReturnId($this->param);
}
return $this->success(['id' => $id]);
}
}
... ...
... ... @@ -77,21 +77,20 @@ class GeoWritings extends Base
*/
public static function sendConfirmMessage($project_id)
{
// $friend = ProjectAssociation::where(['project_id' => $project_id])->first();
// if (empty($friend)) {
// return false;
// }
$friend = ProjectAssociation::where(['project_id' => $project_id])->first();
if (empty($friend)) {
return false;
}
$content_type = 'Link';
$send_time = now();
$type = MessagePush::TYPE_GEO_CONFIRM;
// $friend_id = $friend->friend_id;
$friend_id = $friend->friend_id;
$created_at = $updated_at = now();
$param = [
'project_id' => $project_id,
'send_at' => time()
];
$token = Crypt::encrypt($param);
return ['token'=>$token];
$content_array = [
'title' => "确认核心文章",
'desc' => '确认核心文章',
... ...
<?php
/**
* @remark :
* @name :SettingFaq.php
* @author :lyh
* @method :post
* @time :2025/10/29 16:35
*/
namespace App\Models\WebSetting;
use App\Models\Base;
class SettingFaq extends Base
{
protected $table = 'gl_setting_faq';
}
... ...