request->isAjax()) { $get = $this->request->get(); return JsonServer::success('', AfterSaleLogic::list($get)); } $data = AfterSaleLogic::list(); // 售后状态 $status = AfterSaleModel::getStatusDesc(true); $status = AfterSaleLogic::getStatus($status); $all = AfterSaleLogic::getAll(); return view('', [ 'data' => $data, 'all' => $all, 'status' => $status ]); } /** * @notes 售后详情 * @return \think\response\View * @author suny * @date 2021/7/13 6:59 下午 */ public function detail() { $id = $this->request->get('id'); $detail = AfterSaleLogic::getDetail($id); return view('', [ 'detail' => $detail ]); } /** * @notes 导出Excel * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/4/24 10:20 */ public function export() { $params = $this->request->get(); $result = AfterSaleLogic::list($params, true); if(false === $result) { return JsonServer::error(AfterSaleLogic::getError() ?: '导出失败'); } return JsonServer::success('', $result); } }