public function __construct($id, $config = []) { if (empty($id) || !is_numeric($id)) { throw new InvalidParamException('参数错误!'); } $this->_order = Order::findOne($id); if (!$this->_order) { throw new InvalidParamException('未找到该订单!'); } parent::__construct($config); }