作者 lyh

hx

@@ -18,12 +18,16 @@ use Psr\Container\NotFoundExceptionInterface; @@ -18,12 +18,16 @@ use Psr\Container\NotFoundExceptionInterface;
18 class ServerInformationController extends BaseController 18 class ServerInformationController extends BaseController
19 { 19 {
20 /** 20 /**
21 - * @return JsonResponse 21 + * @remark :获取服务器列表
  22 + * @name :lists
  23 + * @author :lyh
  24 + * @method :post
  25 + * @time :2023/8/1 11:19
22 */ 26 */
23 public function lists() 27 public function lists()
24 { 28 {
25 if(isset($this->map['title']) && !empty($this->map['title'])){ 29 if(isset($this->map['title']) && !empty($this->map['title'])){
26 - $this->map['title'] = ['like','%'.$this->map['title'],',']; 30 + $this->map['title'] = ['like','%'.$this->map['title'],'%'];
27 } 31 }
28 $serverInformationModel = new ServerInformation(); 32 $serverInformationModel = new ServerInformation();
29 $lists = $serverInformationModel->lists($this->map,$this->page,$this->row,$this->order); 33 $lists = $serverInformationModel->lists($this->map,$this->page,$this->row,$this->order);
@@ -25,43 +25,16 @@ class DomainInfoController extends BaseController @@ -25,43 +25,16 @@ class DomainInfoController extends BaseController
25 * @param int $deleted 25 * @param int $deleted
26 * @return JsonResponse 26 * @return JsonResponse
27 */ 27 */
28 - public function lists(int $deleted = DomainInfo::DELETED_NORMAL) 28 + public function lists()
29 { 29 {
30 - $request = $this->param;  
31 - $search = [];  
32 - $search_array = [  
33 - 'domain' => 'domain',  
34 - 'belong' => 'belong_to',  
35 - 'domain_time' => 'domain_end_time',  
36 - 'certificate_time' => 'certificate_end_time'  
37 - ];  
38 - foreach ($search_array as $key => $item) {  
39 - if (isset($request[$key]) && $request[$key]) {  
40 - $search[$item] = $request[$key];  
41 - } 30 + $domainModel = new DomainInfo();
  31 + if(isset($this->map['domain']) && !empty($this->map['domain'])){
  32 + $this->map['domain'] = ['like','%'.$this->map['domain'],'%'];
42 } 33 }
43 - // 每页条数  
44 - $size = request()->input('size', $this->row);  
45 - $query = DomainInfo::query()->select(['id', 'domain', 'belong_to']);  
46 - if ($search) {  
47 - foreach ($search as $key => $item) {  
48 - $query = $query->Where("{$key}", 'like', "%{$item}%");  
49 - }  
50 - }  
51 - $data = $query->where('deleted', $deleted)  
52 - ->orderBy('id', 'desc')  
53 - ->paginate($size);  
54 - return $this->response('success', Code::SUCCESS, $data); 34 + $lists = $domainModel->lists($this->map,$this->page,$this->row,$this->order);
  35 + return $this->response('success', Code::SUCCESS, $lists);
55 } 36 }
56 37
57 - /**  
58 - * 获取软删除的数据  
59 - * @return JsonResponse  
60 - */  
61 - public function delete_list()  
62 - {  
63 - return $this->lists(DomainInfo::DELETED_DELETE);  
64 - }  
65 38
66 /** 39 /**
67 * 添加域名 40 * 添加域名