request->params([ ["payment_id",""], ["order_status",""], ["payment_type",""], ["order_amount",""], ["course_id",""], ["class_id",""], ["staff_id",""], ["resource_id",""], ["after_sales_status",""], ["after_sales_reason",""], ["after_sales_time",""], ["payment_time",""], ["subscription_payment_time",""] ]); 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([ ["payment_id",""], ["order_status",""], ["payment_type",""], ["order_amount",0.00], ["course_id",0], ["class_id",0], ["staff_id",0], ["resource_id",0], ["after_sales_status",""], ["after_sales_reason",""], ["after_sales_time",1747388736], ["payment_time",1747388736], ["subscription_payment_time",1747388736] ]); $this->validate($data, 'app\validate\order_table\OrderTable.add'); $id = (new OrderTableService())->add($data); return success('ADD_SUCCESS', ['id' => $id]); } /** * 订单编辑 * @param $id 订单id * @return \think\Response */ public function edit(int $id){ $data = $this->request->params([ ["payment_id",""], ["order_status",""], ["payment_type",""], ["order_amount",0.00], ["course_id",0], ["class_id",0], ["staff_id",0], ["resource_id",0], ["after_sales_status",""], ["after_sales_reason",""], ["after_sales_time",1747388736], ["payment_time",1747388736], ["subscription_payment_time",1747388736] ]); $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'); } }