where('username|log_title','like','%'.$keys.'%') ->order('id desc') ->paginate(array('list_rows'=> $this->pageSize,'page'=>$page)) ->toArray(); if(!empty($list['data'])){ foreach ($list['data'] as $k => $v) { $useragent = explode('(', $v['log_agent']); $list['data'][$k]['log_agent'] = $useragent[0]; } } $result = ['code'=>0,'msg'=>lang('get info success'),'data'=>$list['data'],'count'=>$list['total']]; return $result; } return View::fetch(); } /** * @throws \Exception * 删除日志 单个+批量 */ public function delete(){ $id = Request::post('id'); if(!$id){ $this->error(lang('id is not exist')); } if(!is_array($id)){ $id = [$id]; } if(LogModel::destroy($id)){ $this->success(lang('delete success')); }else{ $this->error(lang('delete fail')); } } }