| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <?php
- namespace common\enums;
- use common\enums\BaseEnum;
- /**
- *
- * 退换货状态
- *
- * Class RefundStatusEnum
- * @package common\enums
- * @author qimall
- */
- class RefundStatusEnum extends BaseEnum
- {
- // const APPLY = 1;
- // const SALES_RETURN = 2;
- // const AFFIRM_SALES_RETURN = 3;
- // const AFFIRM_RETURN_MONEY = 4;
- // const CONSENT = 5;
- // const NO_PASS_ALWAYS = -1;
- // const CANCEL = -2;
- // const NO_PASS = -3;
- const APPLY = 0;
- const FINISH = 1;
- const HANDEL = 3;
- const RETURN_GOODS = 4;
- const EXCHANGE_GOODS = 5;
- const REFUSE = -1;
- const REVOKE = -2;
- const BUYERS = 1;// 买家
- const SELLER = 2;// 卖家
- // 退款步骤
- const STEP_1 = 1;
- const STEP_2 = 2;
- const STEP_3 = 3;
- const STEP_4 = 4;
- const STEP_5 = 5;
- const STEP_6 = 6;
- const STEP_7 = 7;
- const STEP_8 = 8;
- const STEP_9 = 9;
- const STEP_10 = 10;
- const STEP_11 = 11;
- const STEP_12 = 12;
- const STEP_NEGATIVE_1 = -1;
- const STEP_NEGATIVE_2 = -2;
- /**
- * @return array
- */
- public static function getMap(): array
- {
- return [
- self::APPLY => '售后申请', // 发起了申请,等待卖家处理
- self::HANDEL => '售后处理', // 卖家已同意申请
- self::FINISH => '售后完成',
- self::RETURN_GOODS => '买家退货',// 买家退货,待商家确认
- self::EXCHANGE_GOODS => '重新发货',// 商家重新发货,待买家确认
- self::REFUSE => '拒绝收货',// 卖家拒绝收货
- self::REVOKE => '撤销售后',// 买家主动撤销售后
- ];
- }
- /**
- * 步骤说明
- * @Author: lun
- * @DateTime: 2021/10/8 0008 16:48
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @return array|\string[][]
- */
- public static function getStepStatusText($step = ''): array
- {
- $data = [
- // 退货退款步骤
- self::STEP_1 => [
- 'role' => 1,
- 'title' => '等待商家处理',
- 'desc' => '发起了退款退货申请,等待商家处理',
- ],
- self::STEP_2 => [
- 'role' => 2,
- 'title' => '已同意退货申请,等待买家处理。',
- 'desc' => '已同意退款退货申请,等待买家退货',
- ],
- self::STEP_3 => [
- 'role' => 1,
- 'title' => '买家已退货',
- 'desc' => '已退货,等待商家确认收货',
- ],
- self::STEP_4 => [
- 'role' => 2,
- 'title' => '退货完成',
- 'desc' => '同意退款给买家,本次售后结束',
- ],
- // 仅退款步骤
- self::STEP_5 => [
- 'role' => 1,
- 'title' => '等待商家处理',
- 'desc' => '发起了仅退款申请,等待商家处理',
- ],
- self::STEP_6 => [
- 'role' => 2,
- 'title' => '退款完成',
- 'desc' => '同意退款给买家,本次售后结束',
- ],
- // 换货步骤
- self::STEP_7 => [
- 'role' => 1,
- 'title' => '等待商家处理',
- 'desc' => '发起了换货申请,等待商家处理',
- ],
- self::STEP_8 => [
- 'role' => 2,
- 'title' => '已同意换货申请,等待买家处理。',
- 'desc' => '已同意换货申请,等待买家退货',
- ],
- self::STEP_9 => [
- 'role' => 1,
- 'title' => '买家已退货',
- 'desc' => '已退货,等待商家确认收货',
- ],
- self::STEP_10 => [
- 'role' => 2,
- 'title' => '已重新发货',
- 'desc' => '已重新发货,等待买家确认收货',
- ],
- self::STEP_11 => [
- 'role' => 1,
- 'title' => '换货完成',
- 'desc' => '买家已确认收货,本次售后结束',
- ],
- self::STEP_12 => [
- 'role' => 2,
- 'title' => '换货完成',
- 'desc' => '商家已确认收货,本次售后结束',
- ],
- // 商家拒绝步骤
- self::STEP_NEGATIVE_1 => [
- 'role' => 2,
- 'title' => '拒绝售后申请',
- 'desc' => '商家拒绝售后申请,本次售后结束',
- ],
- self::STEP_NEGATIVE_2 => [
- 'role' => 2,
- 'title' => '商家拒绝退货申请',
- 'desc' => '未收到退货,商家拒绝确认收货',
- ],
- ];
- return $step ? $data[$step] : $data;
- }
- /**
- * 退款步骤对应退款进度条状态
- * @Author: lun
- * @DateTime: 2021/10/12 0012 15:26
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param $step_status
- * @return int
- */
- public static function getStepNumByStatus($step_status)
- {
- $data = [
- // 退货退款
- self::STEP_1 => 1,
- self::STEP_2 => 2,
- self::STEP_3 => 3,
- self::STEP_4 => 4,
- // 仅退款
- self::STEP_5 => 1,
- self::STEP_6 => 3,
- // 换货
- self::STEP_7 => 1,
- self::STEP_8 => 2,
- self::STEP_9 => 3,
- self::STEP_10 => 4,
- self::STEP_11 => 5,
- // 拒绝申请
- self::STEP_NEGATIVE_1 => 3,
- self::STEP_NEGATIVE_2 => 3,
- ];
- return $data[$step_status];
- }
- /**
- * 步骤进度条
- * @Author: lun
- * @DateTime: 2021/10/12 0012 11:42
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param string $type
- * @return array[]|\array[][]
- */
- public static function stepNumArr($type = '')
- {
- $data = [
- 1 => [
- [
- 'title' => '售后申请',
- 'step_num' => 1,
- ],
- [
- 'title' => '处理售后申请',
- 'step_num' => 2,
- ],
- [
- 'title' => '售后完成',
- 'step_num' => 3,
- ],
- ],
- 2 => [
- [
- 'title' => '售后申请',
- 'step_num' => 1,
- ],
- [
- 'title' => '处理售后申请',
- 'step_num' => 2,
- ],
- [
- 'title' => '客户退回物品',
- 'step_num' => 3,
- ],
- [
- 'title' => '售后完成',
- 'step_num' => 4,
- ],
- ],
- 3 => [
- [
- 'title' => '售后申请',
- 'step_num' => 1,
- ],
- [
- 'title' => '处理售后申请',
- 'step_num' => 2,
- ],
- [
- 'title' => '客户退回物品',
- 'step_num' => 3,
- ],
- [
- 'title' => '商家换新发货',
- 'step_num' => 4,
- ],
- [
- 'title' => '售后完成',
- 'step_num' => 5,
- ],
- ],
- ];
- return $type ? $data[$type] : $data;
- }
- /**
- * @return array
- */
- // public static function getMap(): array
- // {
- // return [
- // self::APPLY => '售后申请', // 发起了退款申请,等待卖家处理
- // self::SALES_RETURN => '等待买家退货', // 卖家已同意退款申请,等待买家退货
- // self::AFFIRM_SALES_RETURN => '等待卖家确认收货', // 买家已退货,等待卖家确认收货
- // self::AFFIRM_RETURN_MONEY => '等待卖家确认退款',
- // self::CONSENT => '卖家同意退款',
- // self::NO_PASS_ALWAYS => '退款已拒绝',
- // self::CANCEL => '退款已关闭',
- // self::NO_PASS => '退款申请不通过',
- // ];
- // }
- /**
- * 再退款(售后)状态
- *
- * @return array
- */
- // public static function refund()
- // {
- // return [
- // self::APPLY,
- // self::SALES_RETURN,
- // self::AFFIRM_SALES_RETURN,
- // self::AFFIRM_RETURN_MONEY,
- // ];
- // }
- /**
- * 可发货状态
- *
- * @return array
- */
- // public static function deliver()
- // {
- // return [
- // 0,
- // self::NO_PASS_ALWAYS,
- // self::CANCEL,
- // self::NO_PASS,
- // ];
- // }
- /**
- * 可评价状态
- */
- // public static function evaluate()
- // {
- // return [
- // self::NO_PASS_ALWAYS,
- // self::CANCEL,
- // 0
- // ];
- // }
- }
|