123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- /**
- * AccountConst.php UTF-8
- *
- *
- * @date : 2018/6/13 17:12
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace huolib\constant;
- class AccountConst {
- const STATUS_AUDITING = 1;//审核中
- const STATUS_PULL_ON_SHELVES = 2;//已上架
- const STATUS_PULL_OFF_SHELVES = 3;//已下架
- const STATUS_SOLD_OUT = 4;//已出售
- const STATUS_AUDIT_NOT_PASSED = 5;//审核不通过
- const STATUS_LOCKED = 6;//锁定中
- const ACCOUNT_IS_MINE = 2;//是否自己
- const ACCOUNT_IS_BUY = 1;//1 购买
- const ACCOUNT_IS_SELL = 2;// 2 出卖
- const STATUS_KEEP_NOT = 1;//1 取消收藏
- const STATUS_KEEP = 2;//2收藏
- const ACCOUNT_STATUS_LOCKED = 1;//1锁定
- const ACCOUNT_STATUS_UNLOCKED = 2;//状态 2正常
- const ACCOUNT_MAX_LOCK_TIME = 600;//最长锁定时间10min
- /**
- * @param $status
- * @param bool $all
- *
- * @return array|bool|mixed
- */
- public static function getStatusMsg($status, $all = false) {
- $_msg = array(
- self::STATUS_AUDITING => '审核中',
- self::STATUS_PULL_ON_SHELVES => '已上架',
- self::STATUS_PULL_OFF_SHELVES => '已下架',
- self::STATUS_SOLD_OUT => '已出售',
- self::STATUS_AUDIT_NOT_PASSED => '审核不通过',
- self::STATUS_LOCKED => '锁定中',
- );
- if (true == $all) {
- return $_msg;
- }
- if (!isset($_msg[$status])) {
- return false;
- }
- return $_msg[$status];
- }
- /**
- * @param bool $inc
- *
- * @return array
- */
- public static function getStatuss($inc = false) {
- $_statuss = self::getStatusMsg(null, true);
- if (true == $inc) {
- $_default = ["0" => "选择状态"];
- $_statuss = $_default + $_statuss;
- }
- return $_statuss;
- }
- /**
- * @param $status
- * @param bool $all
- *
- * @return array|bool|mixed
- */
- public static function getAmlStatusMsg($status, $all = false) {
- $_msg = array(
- self::STATUS_KEEP_NOT => '收藏',
- self::STATUS_KEEP => '取消收藏',
- );
- if (true == $all) {
- return $_msg;
- }
- if (!isset($_msg[$status])) {
- return false;
- }
- return $_msg[$status];
- }
- /**
- * @param bool $inc
- *
- * @return array
- */
- public static function getAmlStatuss($inc = false) {
- $_statuss = self::getAmlStatusMsg(null, true);
- if (true == $inc) {
- $_default = ["0" => "选择状态"];
- $_statuss = $_default + $_statuss;
- }
- return $_statuss;
- }
- /**
- * @param $status
- * @param bool $all
- *
- * @return array|bool|mixed
- */
- public static function getAccountStatusMsg($status, $all = false) {
- $_msg = array(
- self::ACCOUNT_STATUS_LOCKED => '锁定',
- self::ACCOUNT_STATUS_UNLOCKED => '正常',
- );
- if (true == $all) {
- return $_msg;
- }
- if (!isset($_msg[$status])) {
- return false;
- }
- return $_msg[$status];
- }
- /**
- * @param bool $inc
- *
- * @return array
- */
- public static function getAccountStatuss($inc = false) {
- $_statuss = self::getAccountStatusMsg(null, true);
- if (true == $inc) {
- $_default = ["0" => "选择状态"];
- $_statuss = $_default + $_statuss;
- }
- return $_statuss;
- }
- }
|