|
...
|
...
|
@@ -22,28 +22,13 @@ class ServerInformationController extends BaseController |
|
|
|
*/
|
|
|
|
public function lists($deleted = ServerInformation::DELETED_NORMAL)
|
|
|
|
{
|
|
|
|
$request = $this->param;
|
|
|
|
$search = [];
|
|
|
|
$search_array = [
|
|
|
|
'ip' => 'ip',
|
|
|
|
'title' => 'title'
|
|
|
|
];
|
|
|
|
foreach ($search_array as $key => $item) {
|
|
|
|
if (isset($request[$key]) && $request[$key]) {
|
|
|
|
$search[$item] = $request[$key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$size = request()->input('size', $this->row);
|
|
|
|
$query = ServerInformation::query()->select(['id', 'title', 'ip']);
|
|
|
|
if ($search) {
|
|
|
|
foreach ($search as $key => $item) {
|
|
|
|
$query = $query->Where("{$key}", 'like', "%{$item}%");
|
|
|
|
}
|
|
|
|
if(isset($this->map['title']) && !empty($this->map['title'])){
|
|
|
|
$this->map['title'] = ['like','%'.$this->map['title'],','];
|
|
|
|
}
|
|
|
|
$data = $query->where('deleted', $deleted)
|
|
|
|
->orderBy('id', 'desc')
|
|
|
|
->paginate($size);
|
|
|
|
return $this->response('success', Code::SUCCESS, $data);
|
|
|
|
$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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|