作者 lyh

Merge branch 'master-server' of http://47.244.231.31:8099/zhl/globalso-v6

@@ -28,6 +28,7 @@ class ServersController extends BaseController @@ -28,6 +28,7 @@ class ServersController extends BaseController
28 if(isset($this->map['server_name']) && !empty($this->map['server_name'])){ 28 if(isset($this->map['server_name']) && !empty($this->map['server_name'])){
29 $this->map['server_name'] = ['like','%'.$this->map['server_name'].'%']; 29 $this->map['server_name'] = ['like','%'.$this->map['server_name'].'%'];
30 } 30 }
  31 + $this->map['status'] = 0;
31 $serversModel = new ServersModel(); 32 $serversModel = new ServersModel();
32 $lists = $serversModel->list($this->map); 33 $lists = $serversModel->list($this->map);
33 $this->response('success',Code::SUCCESS,$lists); 34 $this->response('success',Code::SUCCESS,$lists);
@@ -121,4 +121,21 @@ class ATemplateModuleController extends BaseController @@ -121,4 +121,21 @@ class ATemplateModuleController extends BaseController
121 $list = $project->list($this->map,'id',['id','title']); 121 $list = $project->list($this->map,'id',['id','title']);
122 $this->response('success',Code::SUCCESS,$list); 122 $this->response('success',Code::SUCCESS,$list);
123 } 123 }
  124 +
  125 + /**
  126 + * @remark :修改审核状态
  127 + * @name :auditingStatus
  128 + * @author :lyh
  129 + * @method :post
  130 + * @time :2024/5/23 16:42
  131 + */
  132 + public function auditingStatus(ATemplateModuleLogic $ATemplateModuleLogic){
  133 + $this->request->validate([
  134 + 'id'=>'required'
  135 + ],[
  136 + 'id.required' => 'ID不能为空'
  137 + ]);
  138 + $data = $ATemplateModuleLogic->auditingStatus();
  139 + $this->response('success',Code::SUCCESS,$data);
  140 + }
124 } 141 }
@@ -100,4 +100,19 @@ class ATemplateModuleLogic extends BaseLogic @@ -100,4 +100,19 @@ class ATemplateModuleLogic extends BaseLogic
100 return $this->success(); 100 return $this->success();
101 } 101 }
102 102
  103 + /**
  104 + * @remark :修改状态
  105 + * @name :auditingStatus
  106 + * @author :lyh
  107 + * @method :post
  108 + * @time :2024/5/23 16:44
  109 + */
  110 + public function auditingStatus(){
  111 + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
  112 + if($rs === false){
  113 + $this->fail('修改失败,请联系管理员');
  114 + }
  115 + return $this->success(['id'=>$this->param['id']]);
  116 + }
  117 +
103 } 118 }
@@ -203,7 +203,7 @@ class BlogLogic extends BaseLogic @@ -203,7 +203,7 @@ class BlogLogic extends BaseLogic
203 public function getCategory($category){ 203 public function getCategory($category){
204 $str = ''; 204 $str = '';
205 foreach ($category as $v){ 205 foreach ($category as $v){
206 - $str .= $v.','; 206 + $str .= $v.',';
207 } 207 }
208 return !empty(trim($str,',')) ? ','.$str.',' : ''; 208 return !empty(trim($str,',')) ? ','.$str.',' : '';
209 } 209 }
@@ -59,32 +59,23 @@ class NewsLogic extends BaseLogic @@ -59,32 +59,23 @@ class NewsLogic extends BaseLogic
59 */ 59 */
60 public function newsSave() 60 public function newsSave()
61 { 61 {
62 - //拼接参数  
63 -// DB::beginTransaction();  
64 -// try {  
65 - $this->param = $this->paramProcessing($this->param);  
66 - if (isset($this->param['id']) && !empty($this->param['id'])) {  
67 - $id = $this->param['id'];  
68 - $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0  
69 - $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示  
70 - if($is_upgrade == 0 || $six_read == 1) {  
71 - $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);  
72 - }  
73 - //是否更新路由  
74 - $route = $this->param['url'];  
75 - $this->edit($this->param, ['id' => $id]);  
76 - } else {  
77 - $this->param['sort'] = $this->setNewsSort();  
78 - $id = $this->model->addReturnId($this->param);  
79 - $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);  
80 - $this->edit(['url' => $route], ['id' => $id]); 62 + $this->param = $this->paramProcessing($this->param);
  63 + if (isset($this->param['id']) && !empty($this->param['id'])) {
  64 + $id = $this->param['id'];
  65 + $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
  66 + $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
  67 + if($is_upgrade == 0 || $six_read == 1) {
  68 + $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
81 } 69 }
82 -// //更新路由  
83 -// DB::commit();  
84 -// } catch (\Exception $e) {  
85 -// DB::rollBack();  
86 -// $this->fail('系统错误,请联系管理员');  
87 -// } 70 + //是否更新路由
  71 + $route = $this->param['url'];
  72 + $this->edit($this->param, ['id' => $id]);
  73 + } else {
  74 + $this->param['sort'] = $this->setNewsSort();
  75 + $id = $this->model->addReturnId($this->param);
  76 + $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
  77 + $this->edit(['url' => $route], ['id' => $id]);
  78 + }
88 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); 79 $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
89 $this->curlDelRoute(['new_route'=>$route]); 80 $this->curlDelRoute(['new_route'=>$route]);
90 return $this->success(['id'=>$id]); 81 return $this->success(['id'=>$id]);
@@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic @@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic
223 */ 214 */
224 public function getCategory($category){ 215 public function getCategory($category){
225 $str = ''; 216 $str = '';
226 - if(is_array($category) && $category){  
227 - $str = ','.implode(',',$category).','; 217 + foreach ($category as $v){
  218 + $str .= $v.',';
228 } 219 }
229 - return $str; 220 + return !empty(trim($str,',')) ? ','.$str.',' : '';
230 } 221 }
231 222
232 /** 223 /**
@@ -373,6 +373,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -373,6 +373,7 @@ Route::middleware(['aloginauth'])->group(function () {
373 Route::any('/status', [Aside\Template\ATemplateModuleController::class, 'status'])->name('admin.ATemplateModule_status'); 373 Route::any('/status', [Aside\Template\ATemplateModuleController::class, 'status'])->name('admin.ATemplateModule_status');
374 Route::any('/del', [Aside\Template\ATemplateModuleController::class, 'del'])->name('admin.ATemplateModule_del'); 374 Route::any('/del', [Aside\Template\ATemplateModuleController::class, 'del'])->name('admin.ATemplateModule_del');
375 Route::any('/type', [Aside\Template\ATemplateModuleController::class, 'getType'])->name('admin.ATemplateModule_getType'); 375 Route::any('/type', [Aside\Template\ATemplateModuleController::class, 'getType'])->name('admin.ATemplateModule_getType');
  376 + Route::any('/auditingStatus', [Aside\Template\ATemplateModuleController::class, 'auditingStatus'])->name('admin.ATemplateModule_auditingStatus');
376 Route::any('/getProjectList', [Aside\Template\ATemplateModuleController::class, 'getProjectList'])->name('admin.ATemplateModule_getProjectList'); 377 Route::any('/getProjectList', [Aside\Template\ATemplateModuleController::class, 'getProjectList'])->name('admin.ATemplateModule_getProjectList');
377 }); 378 });
378 //设置类型 379 //设置类型