正在显示
3 个修改的文件
包含
18 行增加
和
33 行删除
| @@ -1284,36 +1284,4 @@ class ProjectController extends BaseController | @@ -1284,36 +1284,4 @@ class ProjectController extends BaseController | ||
| 1284 | $this->response('success',Code::SUCCESS,['url'=>$this->param['url']]); | 1284 | $this->response('success',Code::SUCCESS,['url'=>$this->param['url']]); |
| 1285 | } | 1285 | } |
| 1286 | 1286 | ||
| 1287 | - /** | ||
| 1288 | - * @remark :统计剩余服务时常 | ||
| 1289 | - * @name :serviceNumCount | ||
| 1290 | - * @author :lyh | ||
| 1291 | - * @method :post | ||
| 1292 | - * @time :2025/7/29 14:12 | ||
| 1293 | - */ | ||
| 1294 | - public function serviceNumCount(){ | ||
| 1295 | - $this->request->validate([ | ||
| 1296 | - 'end_date'=>'required', | ||
| 1297 | - 'project_id'=>'required', | ||
| 1298 | - ],[ | ||
| 1299 | - 'end_date.required' => '结束时常不能为空', | ||
| 1300 | - 'project_id.required' => '项目id不能为空', | ||
| 1301 | - ]); | ||
| 1302 | - if(isset($this->param['renewal_record']) && !empty($this->param['renewal_record'])){ | ||
| 1303 | - $paymentModel = new Payment(); | ||
| 1304 | - $renewal_record = Arr::a2s($this->param['renewal_record']); | ||
| 1305 | - $paymentModel->edit(['renewal_record'=>$renewal_record],['project_id'=>$this->param['project_id']]); | ||
| 1306 | - } | ||
| 1307 | - $projectModel = new Project(); | ||
| 1308 | - $projectInfo = $projectModel->read(['id'=>$this->param['project_id']],['uptime','project_type']); | ||
| 1309 | - $diff = (strtotime($this->param['end_date']) - strtotime($projectInfo['uptime'])) / (60 * 60 * 24); | ||
| 1310 | - $deployBuildModel = new DeployBuild(); | ||
| 1311 | - if($projectModel['project_type'] == Project::PROJECT_TYPE_SEO){ | ||
| 1312 | - $param = ['seo_service_duration'=>$diff]; | ||
| 1313 | - }else{ | ||
| 1314 | - $param = ['service_duration'=>$diff]; | ||
| 1315 | - } | ||
| 1316 | - $deployBuildModel->edit($param,['project_id'=>$this->param['project_id']]); | ||
| 1317 | - $this->response('success'); | ||
| 1318 | - } | ||
| 1319 | } | 1287 | } |
| @@ -738,6 +738,24 @@ class ProjectLogic extends BaseLogic | @@ -738,6 +738,24 @@ class ProjectLogic extends BaseLogic | ||
| 738 | //改为异步 | 738 | //改为异步 |
| 739 | NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]); | 739 | NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]); |
| 740 | } | 740 | } |
| 741 | + //推广续费网站单独处理 | ||
| 742 | + if($param['type'] == Project::TYPE_FOUR){ | ||
| 743 | + // 提取非 null 的 expire_at 字段 | ||
| 744 | + $validDates = array_filter( | ||
| 745 | + array_column($param['payment']['renewal_record'] ?? [], 'expire_at'), | ||
| 746 | + fn($date) => !is_null($date) | ||
| 747 | + ); | ||
| 748 | + // 获取最大日期(如果有) | ||
| 749 | + $maxExpireAt = $validDates ? max($validDates) : null; | ||
| 750 | + if(!empty($maxExpireAt)){ | ||
| 751 | + $diff = (strtotime($maxExpireAt) - strtotime($param['uptime'] ?? date('Y-m-d'))) / (60 * 60 * 24); | ||
| 752 | + if($param['project_type'] == Project::PROJECT_TYPE_SEO){ | ||
| 753 | + $param['deploy_build']['seo_service_duration'] = $diff; | ||
| 754 | + }else{ | ||
| 755 | + $param['deploy_build']['service_duration'] = $diff; | ||
| 756 | + } | ||
| 757 | + } | ||
| 758 | + } | ||
| 741 | return $this->success($param); | 759 | return $this->success($param); |
| 742 | } | 760 | } |
| 743 | 761 |
| @@ -205,7 +205,6 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -205,7 +205,6 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 205 | Route::any('/setIsParticiple', [Aside\Project\ProjectController::class, 'setIsParticiple'])->name('admin.project_setIsParticiple');//开启/关闭分词 | 205 | Route::any('/setIsParticiple', [Aside\Project\ProjectController::class, 'setIsParticiple'])->name('admin.project_setIsParticiple');//开启/关闭分词 |
| 206 | Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus'); | 206 | Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus'); |
| 207 | Route::any('/updateTdk', [Aside\Project\ProjectController::class, 'updateTdk'])->name('admin.project_updateTdk');//更新项目tdk | 207 | Route::any('/updateTdk', [Aside\Project\ProjectController::class, 'updateTdk'])->name('admin.project_updateTdk');//更新项目tdk |
| 208 | - Route::any('/serviceNumCount', [Aside\Project\ProjectController::class, 'serviceNumCount'])->name('admin.project_serviceNumCount');//根据续费记录统计剩余服务时常 | ||
| 209 | //获取关键词前缀和后缀 | 208 | //获取关键词前缀和后缀 |
| 210 | Route::prefix('keyword')->group(function () { | 209 | Route::prefix('keyword')->group(function () { |
| 211 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); | 210 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); |
-
请 注册 或 登录 后发表评论