RefundStatusEnum.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <?php
  2. namespace common\enums;
  3. use common\enums\BaseEnum;
  4. /**
  5. *
  6. * 退换货状态
  7. *
  8. * Class RefundStatusEnum
  9. * @package common\enums
  10. * @author qimall
  11. */
  12. class RefundStatusEnum extends BaseEnum
  13. {
  14. // const APPLY = 1;
  15. // const SALES_RETURN = 2;
  16. // const AFFIRM_SALES_RETURN = 3;
  17. // const AFFIRM_RETURN_MONEY = 4;
  18. // const CONSENT = 5;
  19. // const NO_PASS_ALWAYS = -1;
  20. // const CANCEL = -2;
  21. // const NO_PASS = -3;
  22. const APPLY = 0;
  23. const FINISH = 1;
  24. const HANDEL = 3;
  25. const RETURN_GOODS = 4;
  26. const EXCHANGE_GOODS = 5;
  27. const REFUSE = -1;
  28. const REVOKE = -2;
  29. const BUYERS = 1;// 买家
  30. const SELLER = 2;// 卖家
  31. // 退款步骤
  32. const STEP_1 = 1;
  33. const STEP_2 = 2;
  34. const STEP_3 = 3;
  35. const STEP_4 = 4;
  36. const STEP_5 = 5;
  37. const STEP_6 = 6;
  38. const STEP_7 = 7;
  39. const STEP_8 = 8;
  40. const STEP_9 = 9;
  41. const STEP_10 = 10;
  42. const STEP_11 = 11;
  43. const STEP_12 = 12;
  44. const STEP_NEGATIVE_1 = -1;
  45. const STEP_NEGATIVE_2 = -2;
  46. /**
  47. * @return array
  48. */
  49. public static function getMap(): array
  50. {
  51. return [
  52. self::APPLY => '售后申请', // 发起了申请,等待卖家处理
  53. self::HANDEL => '售后处理', // 卖家已同意申请
  54. self::FINISH => '售后完成',
  55. self::RETURN_GOODS => '买家退货',// 买家退货,待商家确认
  56. self::EXCHANGE_GOODS => '重新发货',// 商家重新发货,待买家确认
  57. self::REFUSE => '拒绝收货',// 卖家拒绝收货
  58. self::REVOKE => '撤销售后',// 买家主动撤销售后
  59. ];
  60. }
  61. /**
  62. * 步骤说明
  63. * @Author: lun
  64. * @DateTime: 2021/10/8 0008 16:48
  65. * @Copyright: copyright (c) 2021 广东七件事集团
  66. * @return array|\string[][]
  67. */
  68. public static function getStepStatusText($step = ''): array
  69. {
  70. $data = [
  71. // 退货退款步骤
  72. self::STEP_1 => [
  73. 'role' => 1,
  74. 'title' => '等待商家处理',
  75. 'desc' => '发起了退款退货申请,等待商家处理',
  76. ],
  77. self::STEP_2 => [
  78. 'role' => 2,
  79. 'title' => '已同意退货申请,等待买家处理。',
  80. 'desc' => '已同意退款退货申请,等待买家退货',
  81. ],
  82. self::STEP_3 => [
  83. 'role' => 1,
  84. 'title' => '买家已退货',
  85. 'desc' => '已退货,等待商家确认收货',
  86. ],
  87. self::STEP_4 => [
  88. 'role' => 2,
  89. 'title' => '退货完成',
  90. 'desc' => '同意退款给买家,本次售后结束',
  91. ],
  92. // 仅退款步骤
  93. self::STEP_5 => [
  94. 'role' => 1,
  95. 'title' => '等待商家处理',
  96. 'desc' => '发起了仅退款申请,等待商家处理',
  97. ],
  98. self::STEP_6 => [
  99. 'role' => 2,
  100. 'title' => '退款完成',
  101. 'desc' => '同意退款给买家,本次售后结束',
  102. ],
  103. // 换货步骤
  104. self::STEP_7 => [
  105. 'role' => 1,
  106. 'title' => '等待商家处理',
  107. 'desc' => '发起了换货申请,等待商家处理',
  108. ],
  109. self::STEP_8 => [
  110. 'role' => 2,
  111. 'title' => '已同意换货申请,等待买家处理。',
  112. 'desc' => '已同意换货申请,等待买家退货',
  113. ],
  114. self::STEP_9 => [
  115. 'role' => 1,
  116. 'title' => '买家已退货',
  117. 'desc' => '已退货,等待商家确认收货',
  118. ],
  119. self::STEP_10 => [
  120. 'role' => 2,
  121. 'title' => '已重新发货',
  122. 'desc' => '已重新发货,等待买家确认收货',
  123. ],
  124. self::STEP_11 => [
  125. 'role' => 1,
  126. 'title' => '换货完成',
  127. 'desc' => '买家已确认收货,本次售后结束',
  128. ],
  129. self::STEP_12 => [
  130. 'role' => 2,
  131. 'title' => '换货完成',
  132. 'desc' => '商家已确认收货,本次售后结束',
  133. ],
  134. // 商家拒绝步骤
  135. self::STEP_NEGATIVE_1 => [
  136. 'role' => 2,
  137. 'title' => '拒绝售后申请',
  138. 'desc' => '商家拒绝售后申请,本次售后结束',
  139. ],
  140. self::STEP_NEGATIVE_2 => [
  141. 'role' => 2,
  142. 'title' => '商家拒绝退货申请',
  143. 'desc' => '未收到退货,商家拒绝确认收货',
  144. ],
  145. ];
  146. return $step ? $data[$step] : $data;
  147. }
  148. /**
  149. * 退款步骤对应退款进度条状态
  150. * @Author: lun
  151. * @DateTime: 2021/10/12 0012 15:26
  152. * @Copyright: copyright (c) 2021 广东七件事集团
  153. * @param $step_status
  154. * @return int
  155. */
  156. public static function getStepNumByStatus($step_status)
  157. {
  158. $data = [
  159. // 退货退款
  160. self::STEP_1 => 1,
  161. self::STEP_2 => 2,
  162. self::STEP_3 => 3,
  163. self::STEP_4 => 4,
  164. // 仅退款
  165. self::STEP_5 => 1,
  166. self::STEP_6 => 3,
  167. // 换货
  168. self::STEP_7 => 1,
  169. self::STEP_8 => 2,
  170. self::STEP_9 => 3,
  171. self::STEP_10 => 4,
  172. self::STEP_11 => 5,
  173. // 拒绝申请
  174. self::STEP_NEGATIVE_1 => 3,
  175. self::STEP_NEGATIVE_2 => 3,
  176. ];
  177. return $data[$step_status];
  178. }
  179. /**
  180. * 步骤进度条
  181. * @Author: lun
  182. * @DateTime: 2021/10/12 0012 11:42
  183. * @Copyright: copyright (c) 2021 广东七件事集团
  184. * @param string $type
  185. * @return array[]|\array[][]
  186. */
  187. public static function stepNumArr($type = '')
  188. {
  189. $data = [
  190. 1 => [
  191. [
  192. 'title' => '售后申请',
  193. 'step_num' => 1,
  194. ],
  195. [
  196. 'title' => '处理售后申请',
  197. 'step_num' => 2,
  198. ],
  199. [
  200. 'title' => '售后完成',
  201. 'step_num' => 3,
  202. ],
  203. ],
  204. 2 => [
  205. [
  206. 'title' => '售后申请',
  207. 'step_num' => 1,
  208. ],
  209. [
  210. 'title' => '处理售后申请',
  211. 'step_num' => 2,
  212. ],
  213. [
  214. 'title' => '客户退回物品',
  215. 'step_num' => 3,
  216. ],
  217. [
  218. 'title' => '售后完成',
  219. 'step_num' => 4,
  220. ],
  221. ],
  222. 3 => [
  223. [
  224. 'title' => '售后申请',
  225. 'step_num' => 1,
  226. ],
  227. [
  228. 'title' => '处理售后申请',
  229. 'step_num' => 2,
  230. ],
  231. [
  232. 'title' => '客户退回物品',
  233. 'step_num' => 3,
  234. ],
  235. [
  236. 'title' => '商家换新发货',
  237. 'step_num' => 4,
  238. ],
  239. [
  240. 'title' => '售后完成',
  241. 'step_num' => 5,
  242. ],
  243. ],
  244. ];
  245. return $type ? $data[$type] : $data;
  246. }
  247. /**
  248. * @return array
  249. */
  250. // public static function getMap(): array
  251. // {
  252. // return [
  253. // self::APPLY => '售后申请', // 发起了退款申请,等待卖家处理
  254. // self::SALES_RETURN => '等待买家退货', // 卖家已同意退款申请,等待买家退货
  255. // self::AFFIRM_SALES_RETURN => '等待卖家确认收货', // 买家已退货,等待卖家确认收货
  256. // self::AFFIRM_RETURN_MONEY => '等待卖家确认退款',
  257. // self::CONSENT => '卖家同意退款',
  258. // self::NO_PASS_ALWAYS => '退款已拒绝',
  259. // self::CANCEL => '退款已关闭',
  260. // self::NO_PASS => '退款申请不通过',
  261. // ];
  262. // }
  263. /**
  264. * 再退款(售后)状态
  265. *
  266. * @return array
  267. */
  268. // public static function refund()
  269. // {
  270. // return [
  271. // self::APPLY,
  272. // self::SALES_RETURN,
  273. // self::AFFIRM_SALES_RETURN,
  274. // self::AFFIRM_RETURN_MONEY,
  275. // ];
  276. // }
  277. /**
  278. * 可发货状态
  279. *
  280. * @return array
  281. */
  282. // public static function deliver()
  283. // {
  284. // return [
  285. // 0,
  286. // self::NO_PASS_ALWAYS,
  287. // self::CANCEL,
  288. // self::NO_PASS,
  289. // ];
  290. // }
  291. /**
  292. * 可评价状态
  293. */
  294. // public static function evaluate()
  295. // {
  296. // return [
  297. // self::NO_PASS_ALWAYS,
  298. // self::CANCEL,
  299. // 0
  300. // ];
  301. // }
  302. }