public function __construct($id, $config = [])
{
if (empty($id) || !is_numeric($id)) {
throw new InvalidParamException('参数错误!');
}
$this->_apply = Apply::findOne($id);
if (!$this->_apply) {
throw new InvalidParamException('未找到该申请!');
}
if ($this->_apply->status !== Apply::STATUS_PENDING) {
throw new InvalidParamException('请求错误!');
}
parent::__construct($config);
}