123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <?php
- declare(strict_types=1);
- class errcode
- {
- const Success = 200;
- const ErrProtocolDisabled = 300;
- const ErrApptype = 10000;
- const ErrParamter = 10001;
- const ErrLogin = 10002;
- const ErrHasLogined = 10003;
- const ErrUsertype = 10004;
- const ErrTokenExpire = 10005;
- const ErrSmscodeExpire = 10006;
- const ErrSmscode = 10007;
- const ErrIDbinded = 10008;
- const ErrUserExisted = 10009;
- const ErrPasswd = 10010;
- const ErrMobileNotBinded = 10011;
- const ErrOperRepeat = 10012;
- const ErrAccountStop = 10013;
- const ErrUnLogin = 10014;
- const ErrRegister = 10015;
- const ErrUserOrPass = 10016;
- const ErrFrequentlyRequest = 10017;//请求频繁
- const ErrUploadFileFailed = 10018; //上传文件失败
- const ErrUnImplements = 10019;
- const ErrLittleParamter = 10020;
- const ErrSignParamter = 10021;
- const ErrSpecial = 10100;
- // 购物车模块(10200-10299)
- const ErrCart = 10200;
- const ErrGoodsOff = 10201;
- const ErrCanNotBuyOwn = 10202;
- const ErrStorageShort = 10203;
- const ErrAddCart = 10204;
- const ErrGoodsOutofStock = 10205;
- const ErrGoodsSpecial = 10206;
- const ErrCartDelError = 10207;
- // 订单错误内容
- const ErrOrder = 10300;
- const ErrOrderCanNotCancel = 10301;
- const ErrOrderNotExist = 10302;
- const ErrOrderState = 10303;
- const ErrOrderRefundError = 10304;
- const ErrRefundNotExist = 10305;
- const ErrAddress = 10400;
- const ErrInvoice = 10500;
- const ErrPayment = 10600;
- // 快递内容
- const ErrExpress = 10700;
- const ErrExpressNotExist = 10701;
- const ErrBonus = 10800;
- const ErrBonusType = 10801;
- const ErrBonusMake = 10802;
- const ErrBonusGrabNull = 10803;
- const ErrBonusNotEnough = 10804;
- const ErrBonusSN = 10805;
- const ErrBonusBinded = 10806;
- const ErrBonusComment = 10807;
- const ErrBonusShake = 10808;
- const ErrBonusDailyRank = 10809;
- //套装
- const ErrBLUnExist = 10900;
- const ErrDB = 11000;
- const ErrShake = 11100;
- const ErrRelation = 11200;
- const ErrTopCard = 11300;
- const ErrSms = 12000;
- const ErrSmsLessRepeateMinTime = 12001;
- const ErrGoodsNotExist = 13000;
- const ErrMemberNotExist = 13001;
- const ErrInputParam = 13002;
- const ErrVerifyCode = 13003;
- const ErrMemberExist = 13004;
- const ErrWxNotExist = 13005;
- const ErrLoginType = 13006;
- const ErrGetConfig = 14000;
- const ErrUpfile = 15000;
- const ErrAuthor = 16000;
- const ErrUGC = 17000;
- const ErrRoom = 18000;
- const ErrRoomCreate = 18001;
- const ErrRoomInvite = 18002;
- const ErrRoomLeave = 18003;
- const ErrRoomBuild = 18004;
- const ErrRoomParam = 18005;
- const ErrRoomFactoryOp = 18006;
- const ErrRoomAccessOp = 18007;
- const ErrRoomPush = 18008;
- const ErrRoomChange = 18009;
- const ErrRoomKickout = 18010;
- const ErrRoomTwoFace = 18011;
- const ErrRoomNotice = 18012;
- const ErrAccess = 19000;
- const ErrTalk = 20000;
- const ErrSafeIp = 21000;
- const ErrOperation = 22000;
- const ErrPushQueue = 23000;
- static function msg($code)
- {
- switch ($code) {
- case errcode::Success:
- return '成功';
- case errcode::ErrProtocolDisabled:
- return '协议未启用';
- case errcode::ErrApptype :
- return '应用类型错误';
- case errcode::ErrParamter :
- return '错误的参数.';
- case errcode::ErrLogin :
- return '用户名或密码错误';
- case errcode::ErrHasLogined :
- return '当前在登录状态,请先登出再登录.';
- case errcode::ErrUsertype :
- return '用户类型错误';
- case errcode::ErrTokenExpire :
- return 'token过期';
- case errcode::ErrSmscodeExpire :
- return '验证码过期';
- case errcode::ErrSmscode:
- return '验证码错误';
- case errcode::ErrIDbinded:
- return '用户已经绑定';
- case errcode::ErrMobileNotBinded :
- return '手机号尚未绑定';
- case errcode::ErrOperRepeat :
- return '抱歉,您登录重试次数超过限制,请十分钟后再试~';
- case errcode::ErrAccountStop :
- return '该帐号已经被停用';
- case errcode::ErrUnLogin :
- return '您没有登录不能做此操作.';
- case errcode::ErrSpecial:
- return 'ErrSpecial.';
- case errcode::ErrPayment:
- return '支付错误.';
- case errcode::ErrGoodsNotExist:
- return '商品库存不足或已下架.';
- case errcode::ErrMemberNotExist:
- return '用户不存在.';
- case errcode::ErrInputParam:
- return '输入参数错误';
- case errcode::ErrVerifyCode:
- return '验证码错误';
- case errcode::ErrMemberExist:
- return '用户已经存在';
- case errcode::ErrPasswd:
- return '账号或密码错误';
- case errcode::ErrWxNotExist:
- return '该微信账号还没有注册';
- case errcode::ErrLoginType:
- return '登陆类型错误';
- case errcode::ErrOrderCanNotCancel:
- return '订单已支付或已发送,不能取消';
- case errcode::ErrOrderNotExist:
- return '订单不存在';
- case errcode::ErrExpress:
- return '查询快递出错';
- case errcode::ErrGoodsOff:
- return '商品下架';
- case errcode::ErrCanNotBuyOwn:
- return '不能购买自己商品';
- case errcode::ErrStorageShort:
- return '商品库存不足';
- case errcode::ErrAddCart:
- return '添加购物车失败';
- case errcode::ErrGoodsOutofStock :
- return '商品缺货.';
- case errcode::ErrGoodsSpecial :
- return '该商品不允许加入购物车,请直接购买';
- case errcode::ErrCartDelError :
- return '购物车删除失败.';
- case errcode::ErrGetConfig:
- return '获取配置文件出错';
- case errcode::ErrBLUnExist:
- return '该优惠套装已不存在,建议您单独购买';
- case errcode::ErrDB :
- return '系统错误';
- case errcode::ErrSms :
- return '验证码发送错误';
- case errcode::ErrSmsLessRepeateMinTime:
- return '一分钟内只能发送一次验证码,请稍后再试.';
- case errcode::ErrRoom:
- return '房间出错';
- case errcode::ErrRoomCreate:
- return '房间创建出错.';
- case errcode::ErrRoomInvite:
- return '房间邀请出错.';
- case errcode::ErrRoomLeave:
- return '退出房间出错.';
- case errcode::ErrRoomBuild:
- return '房间重建出错.';
- case errcode::ErrRoomParam:
- return '房间重建参数出错,不存在此房间号.';
- case errcode::ErrRoomFactoryOp:
- return '房间不支持此操作.';
- case errcode::ErrRoomAccessOp:
- return '房间服务器不支持此access操作.';
- case errcode::ErrSignParamter:
- return '请求参数需要做签名.';
- case errcode::ErrSafeIp:
- return '无权限的IP.';
- case errcode::ErrOperation:
- return '操作失败.';
- default :
- return '系统错误.';
- }
- }
- }
|