code = self::SUCCESSFUL_CODE; $result->meg = $msg; $result->data = $data; return $result; } /** * 失败结果 * @param $msg * @param array $data * @return StdClass */ public static function failed($msg, $data = []) { $result = self::getStd(); if (is_callable($data)) $data = $data(); $result->code = self::FAILED_CODE; $result->meg = $msg; $result->data = $data; return $result; } }