Files
anmo/server/app/common/enum/accountLog/ShopAccountLogEnum.php
2025-08-19 14:16:51 +08:00

166 lines
5.3 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | likeshop100%开源免费商用商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | 商业版本务必购买商业授权,以免引起法律纠纷
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshopTeam
// +----------------------------------------------------------------------
namespace app\common\enum\accountLog;
class ShopAccountLogEnum
{
//变动对象
const MONEY = 1;//可用余额
const DEPOSIT = 2; //保证金
//动作
const DEC = 1;//减少
const INC = 2;//增加
//可用余额变动类型
const ADMIN_INC_MONEY = 100;//管理员增加可用余额
const ADMIN_DEC_MONEY = 101;//管理员扣减可用余额
const ORDER_ADD_MONEY = 102;//订单增加可用余额
const WITHDRAW_DEC_MONEY = 103;//提现佣金
const WITHDRAW_INC_MONEY = 104;//提现失败退出佣金
const ORDER_ADD_CART_MONEY = 105;//订单增加可用余额车费
//可提现余额变动类型deposit
const ADMIN_INC_DEPOSIT = 200;//管理员增加保证金
const ADMIN_DEC_DEPOSIT = 201;//管理员扣减保证金
const RECHARGE_INC_DEPOSIT = 202; //充值增加保证金
const WITHDRAW_DEC_DEPOSIT = 203; //提现保证金
const WITHDRAW_INC_DEPOSIT = 204; //提现失败退出保证金
//佣金余额(变动类型汇总)
const MONEY_DESC = [
self::ADMIN_INC_MONEY,
self::ADMIN_DEC_MONEY,
self::ORDER_ADD_MONEY,
self::WITHDRAW_DEC_MONEY,
self::ORDER_ADD_CART_MONEY,
self::WITHDRAW_INC_MONEY,
];
//保证金
const DEPOSIT_DESC = [
self::ADMIN_INC_DEPOSIT,
self::ADMIN_DEC_DEPOSIT,
self::RECHARGE_INC_DEPOSIT,
self::WITHDRAW_DEC_DEPOSIT,
self::WITHDRAW_INC_DEPOSIT,
];
/**
* @notes 动作描述
* @param $action
* @param false $flag
* @return string|string[]
* @author ljj
* @date 2022/10/28 5:08 下午
*/
public static function getActionDesc($action, $flag = false)
{
$desc = [
self::DEC => '减少',
self::INC => '增加',
];
if($flag) {
return $desc;
}
return $desc[$action] ?? '';
}
/**
* @notes 师傅佣金变动类型
* @param $from
* @return string|string[]
* @author cjhao
* @date 2024/9/13 13:10
*/
public static function getCommissionTypeDesc($from = true){
$desc = [
self::ADMIN_INC_MONEY => '管理员增加佣金',
self::ADMIN_DEC_MONEY => '管理员扣减佣金',
self::ORDER_ADD_MONEY => '订单佣金结算',
self::ORDER_ADD_CART_MONEY => '订单车费结算',
self::WITHDRAW_DEC_MONEY => '提现佣金',
self::WITHDRAW_INC_MONEY => '提现失败退还佣金',
];
if(true === $from){
return $desc;
}
return $desc[$from] ?? '';
}
/**
* @notes 保证金变动类型
* @param $from
* @return string|string[]
* @author cjhao
* @date 2024/9/13 13:15
*/
public static function getDepositTypeDesc($from = true)
{
$desc = [
self::ADMIN_INC_DEPOSIT => '管理员增加保证金',
self::ADMIN_DEC_DEPOSIT => '管理员扣减保证金',
self::RECHARGE_INC_DEPOSIT => '充值增加保证金',
self::WITHDRAW_DEC_DEPOSIT => '提现保证金',
self::WITHDRAW_INC_DEPOSIT => '提现失败退还保证金',
];
if(true === $from){
return $desc;
}
return $desc[$from] ?? '';
}
/**
* @notes 变动类型描述
* @param $changeType
* @param false $flag
* @return string|string[]
* @author ljj
* @date 2022/10/28 5:09 下午
*/
public static function getChangeTypeDesc($changeType, $flag = false)
{
$desc = [
self::ADMIN_INC_MONEY => '管理员增加佣金',
self::ADMIN_DEC_MONEY => '管理员扣减佣金',
self::ORDER_ADD_MONEY => '完成订单增加佣金',
self::ADMIN_INC_DEPOSIT => '管理员增加保证金',
self::ADMIN_DEC_DEPOSIT => '管理员扣减保证金',
self::RECHARGE_INC_DEPOSIT => '充值增加保证金',
self::WITHDRAW_DEC_DEPOSIT => '提现保证金',
self::WITHDRAW_INC_DEPOSIT => '提现失败退还保证金',
self::WITHDRAW_DEC_MONEY => '提现佣金',
self::WITHDRAW_INC_MONEY => '提现失败退还佣金',
self::ORDER_ADD_CART_MONEY => '订单车费结算',
];
if($flag) {
return $desc;
}
return $desc[$changeType] ?? '';
}
}