'后台退款', ]; if ($value === true) { return $data; } return $data[$value]; } /** * @notes 退款状态 * @param bool $value * @return string|string[] * @author 段誉 * @date 2022/12/1 10:43 */ public static function getStatusDesc($value = true) { $data = [ self::REFUND_ING => '退款中', self::REFUND_SUCCESS => '退款成功', self::REFUND_ERROR => '退款失败', ]; if ($value === true) { return $data; } return $data[$value]; } /** * @notes 退款方式 * @param bool $value * @return string|string[] * @author 段誉 * @date 2022/12/1 10:43 */ public static function getWayDesc($value = true) { $data = [ self::REFUND_ONLINE => '线上退款', self::REFUND_OFFLINE => '线下退款', ]; if ($value === true) { return $data; } return $data[$value]; } /** * @notes 通过支付方式获取退款方式 * @param $payWay * @return int * @author 段誉 * @date 2022/12/6 10:31 */ public static function getRefundWayByPayWay($payWay) { if (in_array($payWay, [PayEnum::ALI_PAY, PayEnum::WECHAT_PAY])) { return self::REFUND_ONLINE; } return self::REFUND_OFFLINE; } }