request->params([ ["order_status",""], ["payment_type",""], ["resource_id",""], ["order_type",""] ]); return success((new OrderTableService())->getPage($data)); } /** * 订单详情 * @param int $id * @return \think\Response */ public function info(int $id){ return success((new OrderTableService())->getInfo($id)); } /** * 添加订单 * @return \think\Response */ public function add(){ $data = $this->request->params([ ["resource_id",0], // ["order_status",""], ["payment_type",""], ["order_amount",0.00], ["course_id",0], ["class_id",0], ]); $this->validate($data, 'app\validate\order_table\OrderTable.add'); return (new OrderTableService())->add($data); } /** * 订单编辑 * @param $id 订单id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["resource_id",0], // ["order_status",""], ["payment_type",""], ["order_amount",0.00], ["course_id",0], ["class_id",0], ]); $this->validate($data, 'app\validate\order_table\OrderTable.edit'); (new OrderTableService())->edit($id, $data); return success('EDIT_SUCCESS'); } /** * 订单删除 * @param $id 订单id * @return \think\Response */ public function del(int $id){ (new OrderTableService())->del($id); return success('DELETE_SUCCESS'); } public function getCustomerResourcesAll(){ return success(( new OrderTableService())->getCustomerResourcesAll()); } public function getCourseAll(){ return success(( new OrderTableService())->getCourseAll()); } public function getClassGradeAll(){ return success(( new OrderTableService())->getClassGradeAll()); } public function getPersonnelAll(){ return success(( new OrderTableService())->getPersonnelAll()); } /** * 获取订单详情(带完整关联数据) * @param int $id * @return \think\Response */ public function getOrderDetail(int $id){ return success((new OrderTableService())->getOrderDetail($id)); } }