1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App;
- /**
- * API服务端 - 错误码
- * @author Flc <2016-7-31 11:27:09>
- */
- class Error
- {
- /**
- * 错误码
- * @var [type]
- */
- public static $errCodes = [
- 0 => "成功",
- 1001 => '未分配销售'
-
- ];
- /**
- * 返回错误码
- * @var string
- */
- public static function getError($code = "400", $_ = false)
- {
- if (! isset(self::$errCodes[$code])) {
- $code = "400";
- }
- return ($_ ? "[{$code}]" : "")
- . self::$errCodes[$code];
- }
- }
|