123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\dict\shop;
- /**
- * 店铺账户变动方式
- * Class ShopAccountChangeTypeDict
- * @package app\dict\member
- */
- class ShopAccountDict
- {
- const ORDER = 'order';
- const REFUND = 'refund';//退款
- const SERVICE = 'service';//服务费
- const COUPON = 'coupon';//优惠券补贴
- const COUPON_REFUND = 'coupon_refund';//返还优惠券补贴
- const CASH_OUT = 'cash_out';
- /**
- * 获取账户变动方式
- * @param string $type
- * @return array
- */
- public static function getType(string $type = ''):array
- {
- $data = [
- //订单结算
- self::ORDER => [
- //名称
- 'name' => get_lang('dict_site_shop_account.order'),
- //是否增加
- 'inc' => 1,
- //是否减少
- 'dec' => 0,
- ],
- //订单退款
- self::REFUND => [
- //名称
- 'name' => get_lang('dict_site_shop_account.refund'),
- //是否增加
- 'inc' => 0,
- //是否减少
- 'dec' => 1,
- ],
- //优惠券补贴
- self::COUPON => [
- //名称
- 'name' => get_lang('dict_site_shop_account.coupon'),
- //是否增加
- 'inc' => 1,
- //是否减少
- 'dec' => 0,
- ],
- //返还优惠券补贴
- self::COUPON_REFUND => [
- //名称
- 'name' => get_lang('dict_site_shop_account.coupon_refund'),
- //是否增加
- 'inc' => 0,
- //是否减少
- 'dec' => 1,
- ],
- //店铺提现
- self::CASH_OUT => [
- //名称
- 'name' => get_lang('dict_site_shop_account.account_cash_out'),
- //是否增加
- 'inc' => 0,
- //是否减少
- 'dec' => 1,
- ],
- ];
- if (empty($type)) {
- return $data;
- }
- return $data[$type] ?? [];
- }
- const MALL_ORDER = 'order';
- const MALL_SERVICE_REFUND = 'refund';//退还服务费
- const MALL_SERVICE = 'service';//服务费
- const MALL_COUPON = 'coupon';//扣除优惠券补贴
- const MALL_COUPON_REFUND = 'coupon_refund';//退还优惠券补贴
- public function getMallType(){
- $data = [
- //服务费
- self::MALL_SERVICE => [
- //名称
- 'name' => get_lang('dict_site_shop_account.mall_service'),
- //是否增加
- 'inc' => 1,
- //是否减少
- 'dec' => 0,
- ],
- //订单退款
- self::MALL_SERVICE_REFUND => [
- //名称
- 'name' => get_lang('dict_site_shop_account.mall_service_refund'),
- //是否增加
- 'inc' => 0,
- //是否减少
- 'dec' => 1,
- ],
- //优惠券补贴
- self::MALL_COUPON => [
- //名称
- 'name' => get_lang('dict_site_shop_account.mall_coupon'),
- //是否增加
- 'inc' => 0,
- //是否减少
- 'dec' => 1,
- ],
- //退还还优惠券补贴
- self::MALL_COUPON_REFUND => [
- //名称
- 'name' => get_lang('dict_site_shop_account.mall_coupon_refund'),
- //是否增加
- 'inc' => 1,
- //是否减少
- 'dec' => 0,
- ],
- ];
- if (empty($type)) {
- return $data;
- }
- return $data[$type] ?? [];
- }
- }
|