作者 lyh

ggx

@@ -55,9 +55,8 @@ class ProjectController extends BaseController @@ -55,9 +55,8 @@ class ProjectController extends BaseController
55 ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') 55 ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
56 ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id'); 56 ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id');
57 $query = $this->searchParam($query); 57 $query = $this->searchParam($query);
58 - $lists = $query->orderBy('gl_project.id', 'desc')->paginate($this->row, $this->selectParam(), 'page', $this->page); 58 + $lists = $query->orderBy('gl_project.id', 'desc')->paginate($this->row, $this->selectParam(), 'page', $this->page)->toArray();
59 if(!empty($lists) && !empty($lists['list'])){ 59 if(!empty($lists) && !empty($lists['list'])){
60 - $lists = $lists->toArray();  
61 foreach ($lists['list'] as $k => $v){ 60 foreach ($lists['list'] as $k => $v){
62 $v = $this->handleParam($v); 61 $v = $this->handleParam($v);
63 $lists['list'][$k] = $v; 62 $lists['list'][$k] = $v;
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :CNoticeController.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2023/9/12 10:04
  8 + */
  9 +
  10 +namespace App\Http\Controllers\Bside\BCom;
  11 +
  12 +use App\Enums\Common\Code;
  13 +use App\Http\Controllers\Bside\BaseController;
  14 +use App\Http\Logic\Bside\Setting\WebSettingLogic;
  15 +use App\Models\Com\UpdateNotify;
  16 +use Illuminate\Http\Request;
  17 +
  18 +class CNoticeController extends BaseController
  19 +{
  20 + /**
  21 + * 更新通知C端
  22 + * @param Request $request
  23 + * @param WebSettingLogic $webSettingLogic
  24 + */
  25 + public function sendNotify(WebSettingLogic $webSettingLogic){
  26 + $type = $this->request->input('type', UpdateNotify::TYPE_MASTER);
  27 + if (FALSE == in_array($type, [UpdateNotify::TYPE_MASTER, UpdateNotify::TYPE_MINOR])){
  28 + $this->response('非法参数!', Code::USER_ERROR);
  29 + }
  30 + $page = $this->request->input('page', UpdateNotify::PAGE_ALL);
  31 + if (FALSE == in_array($type, [UpdateNotify::PAGE_ALL, UpdateNotify::PAGE_SINGLE])){
  32 + $this->response('非法参数!', Code::USER_ERROR);
  33 + }
  34 + $list = $webSettingLogic->sendNotifyMessage($type,$page);
  35 + if(!empty($list)){
  36 + $this->response('当前页面正在生成了,请完成后再点击',Code::USER_ERROR,$list);
  37 + }
  38 + $this->response('success');
  39 + }
  40 +}
@@ -35,24 +35,4 @@ class WebSettingController extends BaseController @@ -35,24 +35,4 @@ class WebSettingController extends BaseController
35 $this->response('success'); 35 $this->response('success');
36 } 36 }
37 37
38 - /**  
39 - * 更新通知C端  
40 - * @param Request $request  
41 - * @param WebSettingLogic $webSettingLogic  
42 - */  
43 - public function sendNotify(WebSettingLogic $webSettingLogic){  
44 - $type = $this->request->input('type', UpdateNotify::TYPE_MASTER);  
45 - if (FALSE == in_array($type, [UpdateNotify::TYPE_MASTER, UpdateNotify::TYPE_MINOR])){  
46 - $this->response('非法参数!', Code::USER_ERROR);  
47 - }  
48 - $page = $this->request->input('page', UpdateNotify::PAGE_ALL);  
49 - if (FALSE == in_array($type, [UpdateNotify::PAGE_ALL, UpdateNotify::PAGE_SINGLE])){  
50 - $this->response('非法参数!', Code::USER_ERROR);  
51 - }  
52 - $list = $webSettingLogic->sendNotifyMessage($type,$page);  
53 - if(!empty($list)){  
54 - $this->response('当前页面正在生成了,请完成后再点击',Code::USER_ERROR,$list);  
55 - }  
56 - $this->response('success');  
57 - }  
58 } 38 }
@@ -120,7 +120,8 @@ Route::middleware(['bloginauth'])->group(function () { @@ -120,7 +120,8 @@ Route::middleware(['bloginauth'])->group(function () {
120 //首页设置 120 //首页设置
121 Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'lists'])->name('web_setting_lists'); 121 Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'lists'])->name('web_setting_lists');
122 Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'save'])->name('web_setting_save'); 122 Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'save'])->name('web_setting_save');
123 - Route::any('/sendNotify', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'sendNotify'])->name('web_setting_sendNotify'); 123 + //通知
  124 + Route::any('/sendNotify', [\App\Http\Controllers\Bside\BCom\CNoticeController::class, 'sendNotify'])->name('web_setting_sendNotify');
124 125
125 //第三方代码获取与设置 126 //第三方代码获取与设置
126 Route::prefix('html')->group(function () { 127 Route::prefix('html')->group(function () {