request->only(['type', 'list', 'addr_id', 'remark' => ''], 'post'); $val = Validate::rule([ 'type|购买类型' => 'require|number|in:' . MasterOrderModel::$type_exchange_good . ',' . MasterOrderModel::$type_shopping_good . ',' . MasterOrderModel::$type_service, 'list|购买列表' => 'require|array|max:100', 'addr_id|收货地址' => 'require|number|gt:0', 'remark|备注' => 'max:255' ]); if (!$val->check($param)) throw new ValidateException($val->getError()); $val2 = Validate::rule([ 'id' => 'require|number|gt:0', 'num|购买数量' => 'require|number|max:99999999', ]); foreach ($param['list'] as $list) { if (!$val2->check($list)) throw new ValidateException($val2->getError()); } return OrderLogic::add($param); } //订单列表 public function list() { $param = $this->request->only(['page' => 1, 'size' => 10, 'status' => ''], 'post'); return OrderLogic::list($param); } //订单详情 public function info() { $id = $this->request->post('id/d', 0); return OrderLogic::info($id); } //查看物流信息 public function express(){ $post_code = $this->request->post('post_code',''); return OrderLogic::express($post_code); } }