// +---------------------------------------------------------------------- namespace app\admin\controller\users; use app\admin\controller\Auth; use mall\response\Response; use think\facade\Request; use think\facade\View; use app\admin\service\users\Report as ReportService; class Report extends Auth { /** * 列表 * @return string|\think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function index(){ if(Request::isAjax()){ $list = ReportService::getList(Request::param()); return Response::returnArray("ok",0,$list['data'],$list['count']); } return View::fetch(); } /** * 详情 * @return string|\think\response\Json */ public function detail(){ try{ if(Request::isAjax()){ return Response::returnArray("操作成功"); } return View::fetch("",ReportService::detail(Request::param("id",0,"intval"))); }catch (\Exception $ex){ } } /** * 删除 * @return \think\response\Json */ public function delete(){ try { ReportService::delete(Request::param("id",0,"intval")); return Response::returnArray("删除成功"); } catch (\Exception $ex) { return Response::returnArray($ex->getMessage(),0); } } }