|
...
|
...
|
@@ -26,7 +26,6 @@ class ServerInformationController extends BaseController |
|
|
|
$this->map['title'] = ['like','%'.$this->map['title'],','];
|
|
|
|
}
|
|
|
|
$serverInformationModel = new ServerInformation();
|
|
|
|
$this->map['deleted'] = ServerInformation::DELETED_NORMAL;
|
|
|
|
$lists = $serverInformationModel->lists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
$this->response('success', Code::SUCCESS, $lists);
|
|
|
|
|
|
...
|
...
|
@@ -82,14 +81,6 @@ class ServerInformationController extends BaseController |
|
|
|
$this->response('服务器删除成功!');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取软删除的数据
|
|
|
|
* @return JsonResponse
|
|
|
|
*/
|
|
|
|
public function delete_list()
|
|
|
|
{
|
|
|
|
return $this->lists(ServerInformation::DELETED_DELETE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 恢复数据
|
|
...
|
...
|
@@ -105,33 +96,6 @@ class ServerInformationController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 搜索
|
|
|
|
* @param Request $request
|
|
|
|
* @return JsonResponse
|
|
|
|
*/
|
|
|
|
public function search(Request $request)
|
|
|
|
{
|
|
|
|
$search = [];
|
|
|
|
$ip = $request->input('ip');
|
|
|
|
if ($ip) {
|
|
|
|
$search['ip'] = $ip;
|
|
|
|
}
|
|
|
|
$remark = $request->input('title');
|
|
|
|
if ($remark) {
|
|
|
|
$search['title'] = $remark;
|
|
|
|
}
|
|
|
|
if (empty($search)) {
|
|
|
|
return $this->response('请输入搜索内容', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$query = ServerInformation::query()->select(['id', 'title', 'ip']);
|
|
|
|
foreach ($search as $key => $item) {
|
|
|
|
$query = $query->Where("{$key}", 'like', "%{$item}%");
|
|
|
|
}
|
|
|
|
$size = $request->input('size', $this->row);
|
|
|
|
$query = $query->orderBy('id', 'desc')->paginate($size);
|
|
|
|
return $this->response('success', Code::SUCCESS, $query);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 服务器信息
|
...
|
...
|
|