request->only(['type', 'list', 'addr_id'], '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' ]); 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 PayLogic::getPrepayId($param); } //微信支付成功后的异步通知及订单处理 public function Notify() { return PayLogic::Notify(); } //检查支付结果 public function checkPayResult() { $param = $this->request->only(['pay_code'], 'post'); $val = Validate::rule(['pay_code|支付编码' => 'require|length:18']); if (!$val->check($param)) throw new ValidateException($val->getError()); return PayLogic::checkPayResult($param['pay_code']); } }