ShopAccountDict.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\shop;
  12. /**
  13. * 店铺账户变动方式
  14. * Class ShopAccountChangeTypeDict
  15. * @package app\dict\member
  16. */
  17. class ShopAccountDict
  18. {
  19. const ORDER = 'order';
  20. const REFUND = 'refund';//退款
  21. const SERVICE = 'service';//服务费
  22. const COUPON = 'coupon';//优惠券补贴
  23. const COUPON_REFUND = 'coupon_refund';//返还优惠券补贴
  24. const CASH_OUT = 'cash_out';
  25. /**
  26. * 获取账户变动方式
  27. * @param string $type
  28. * @return array
  29. */
  30. public static function getType(string $type = ''):array
  31. {
  32. $data = [
  33. //订单结算
  34. self::ORDER => [
  35. //名称
  36. 'name' => get_lang('dict_site_shop_account.order'),
  37. //是否增加
  38. 'inc' => 1,
  39. //是否减少
  40. 'dec' => 0,
  41. ],
  42. //订单退款
  43. self::REFUND => [
  44. //名称
  45. 'name' => get_lang('dict_site_shop_account.refund'),
  46. //是否增加
  47. 'inc' => 0,
  48. //是否减少
  49. 'dec' => 1,
  50. ],
  51. //优惠券补贴
  52. self::COUPON => [
  53. //名称
  54. 'name' => get_lang('dict_site_shop_account.coupon'),
  55. //是否增加
  56. 'inc' => 1,
  57. //是否减少
  58. 'dec' => 0,
  59. ],
  60. //返还优惠券补贴
  61. self::COUPON_REFUND => [
  62. //名称
  63. 'name' => get_lang('dict_site_shop_account.coupon_refund'),
  64. //是否增加
  65. 'inc' => 0,
  66. //是否减少
  67. 'dec' => 1,
  68. ],
  69. //店铺提现
  70. self::CASH_OUT => [
  71. //名称
  72. 'name' => get_lang('dict_site_shop_account.account_cash_out'),
  73. //是否增加
  74. 'inc' => 0,
  75. //是否减少
  76. 'dec' => 1,
  77. ],
  78. ];
  79. if (empty($type)) {
  80. return $data;
  81. }
  82. return $data[$type] ?? [];
  83. }
  84. const MALL_ORDER = 'order';
  85. const MALL_SERVICE_REFUND = 'refund';//退还服务费
  86. const MALL_SERVICE = 'service';//服务费
  87. const MALL_COUPON = 'coupon';//扣除优惠券补贴
  88. const MALL_COUPON_REFUND = 'coupon_refund';//退还优惠券补贴
  89. public function getMallType(){
  90. $data = [
  91. //服务费
  92. self::MALL_SERVICE => [
  93. //名称
  94. 'name' => get_lang('dict_site_shop_account.mall_service'),
  95. //是否增加
  96. 'inc' => 1,
  97. //是否减少
  98. 'dec' => 0,
  99. ],
  100. //订单退款
  101. self::MALL_SERVICE_REFUND => [
  102. //名称
  103. 'name' => get_lang('dict_site_shop_account.mall_service_refund'),
  104. //是否增加
  105. 'inc' => 0,
  106. //是否减少
  107. 'dec' => 1,
  108. ],
  109. //优惠券补贴
  110. self::MALL_COUPON => [
  111. //名称
  112. 'name' => get_lang('dict_site_shop_account.mall_coupon'),
  113. //是否增加
  114. 'inc' => 0,
  115. //是否减少
  116. 'dec' => 1,
  117. ],
  118. //退还还优惠券补贴
  119. self::MALL_COUPON_REFUND => [
  120. //名称
  121. 'name' => get_lang('dict_site_shop_account.mall_coupon_refund'),
  122. //是否增加
  123. 'inc' => 1,
  124. //是否减少
  125. 'dec' => 0,
  126. ],
  127. ];
  128. if (empty($type)) {
  129. return $data;
  130. }
  131. return $data[$type] ?? [];
  132. }
  133. }