作者 lyh

hx

... ... @@ -18,12 +18,16 @@ use Psr\Container\NotFoundExceptionInterface;
class ServerInformationController extends BaseController
{
/**
* @return JsonResponse
* @remark :获取服务器列表
* @name :lists
* @author :lyh
* @method :post
* @time :2023/8/1 11:19
*/
public function lists()
{
if(isset($this->map['title']) && !empty($this->map['title'])){
$this->map['title'] = ['like','%'.$this->map['title'],','];
$this->map['title'] = ['like','%'.$this->map['title'],'%'];
}
$serverInformationModel = new ServerInformation();
$lists = $serverInformationModel->lists($this->map,$this->page,$this->row,$this->order);
... ...
... ... @@ -25,43 +25,16 @@ class DomainInfoController extends BaseController
* @param int $deleted
* @return JsonResponse
*/
public function lists(int $deleted = DomainInfo::DELETED_NORMAL)
public function lists()
{
$request = $this->param;
$search = [];
$search_array = [
'domain' => 'domain',
'belong' => 'belong_to',
'domain_time' => 'domain_end_time',
'certificate_time' => 'certificate_end_time'
];
foreach ($search_array as $key => $item) {
if (isset($request[$key]) && $request[$key]) {
$search[$item] = $request[$key];
}
$domainModel = new DomainInfo();
if(isset($this->map['domain']) && !empty($this->map['domain'])){
$this->map['domain'] = ['like','%'.$this->map['domain'],'%'];
}
// 每页条数
$size = request()->input('size', $this->row);
$query = DomainInfo::query()->select(['id', 'domain', 'belong_to']);
if ($search) {
foreach ($search as $key => $item) {
$query = $query->Where("{$key}", 'like', "%{$item}%");
}
}
$data = $query->where('deleted', $deleted)
->orderBy('id', 'desc')
->paginate($size);
return $this->response('success', Code::SUCCESS, $data);
$lists = $domainModel->lists($this->map,$this->page,$this->row,$this->order);
return $this->response('success', Code::SUCCESS, $lists);
}
/**
* 获取软删除的数据
* @return JsonResponse
*/
public function delete_list()
{
return $this->lists(DomainInfo::DELETED_DELETE);
}
/**
* 添加域名
... ...