error; } /** * @notes 设置错误信息 * @param $error * @author 段誉 * @date 2021/7/21 18:20 */ public function setError($error) { $this->error = $error; // $class = app('request')->controller(); // $action = app('request')->action(); // $errorMsg = $class.'/'.$action.'-'.$error; // Log::write('支付错误:'.$errorMsg); } /** * @notes 是否存在错误 * @return bool * @author 段誉 * @date 2021/7/21 18:32 */ public function hasError() { return !empty($this->error); } /** * @notes 设置状态码 * @param $code * @author 段誉 * @date 2021/7/28 17:05 */ public function setReturnCode($code) { $this->returnCode = $code; } /** * @notes 特殊场景返回指定状态码,默认为0 * @return int * @author 段誉 * @date 2021/7/28 15:14 */ public function getReturnCode() { return $this->returnCode; } }