chore(src): 所有代码上传
This commit is contained in:
@@ -1,52 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\goods;
|
||||
|
||||
|
||||
/**
|
||||
* 商品公共属性
|
||||
*/
|
||||
class GoodsDict
|
||||
{
|
||||
|
||||
const real = 1;
|
||||
const virtual = 2;
|
||||
const virtualcard = 3;
|
||||
const service = 4;
|
||||
const card = 5;
|
||||
const weigh = 6;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::real => '实物商品',
|
||||
self::virtual => '虚拟商品',
|
||||
self::virtualcard => '电子卡密',
|
||||
self::service => '服务项目',
|
||||
self::card => '卡项套餐',
|
||||
self::weigh => '称重商品',
|
||||
];
|
||||
//todo 插件商品类型应该用钩子获取
|
||||
$temp_list = array_filter(event('GetGoodsClass'));
|
||||
if(!empty($temp_list)){
|
||||
foreach($temp_list as $v){
|
||||
$list = array_merge($list, $v);
|
||||
}
|
||||
}
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\goods;
|
||||
|
||||
|
||||
/**
|
||||
* 商品公共属性
|
||||
*/
|
||||
class GoodsDict
|
||||
{
|
||||
|
||||
const real = 1;
|
||||
const virtual = 2;
|
||||
const virtualcard = 3;
|
||||
const service = 4;
|
||||
const card = 5;
|
||||
const weigh = 6;
|
||||
|
||||
/**
|
||||
* 商品类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::real => '实物商品',
|
||||
self::virtual => '虚拟商品',
|
||||
self::virtualcard => '电子卡密',
|
||||
self::service => '服务项目',
|
||||
self::card => '卡项套餐',
|
||||
self::weigh => '称重商品',
|
||||
];
|
||||
//todo 插件商品类型应该用钩子获取
|
||||
$temp_list = array_filter(event('GetGoodsClass'));
|
||||
if(!empty($temp_list)){
|
||||
foreach($temp_list as $v){
|
||||
$list = array_merge($list, $v);
|
||||
}
|
||||
}
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const virtual_auto_deliver = 'auto_deliver';
|
||||
const virtual_artificial_deliver = 'artificial_deliver';
|
||||
const virtual_verify = 'verify';
|
||||
|
||||
/**
|
||||
* 获取虚拟商品发货方式
|
||||
* @param $type
|
||||
* @return void
|
||||
*/
|
||||
public static function getVirtualDeliverType($type = ''){
|
||||
$list = [
|
||||
self::virtual_auto_deliver => '自动发货',
|
||||
self::virtual_artificial_deliver => '手动发货',
|
||||
self::virtual_verify => '到店核销',
|
||||
];
|
||||
//todo 插件商品类型应该用钩子获取
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const service_permanent = 0;
|
||||
const service_day = 1;
|
||||
const service_day_expire = 2;
|
||||
|
||||
public static function getVerifyValidityType($type = ''){
|
||||
$list = [
|
||||
self::service_permanent => '永久',
|
||||
self::service_day => '指定几日内有效',
|
||||
self::service_day_expire => '指定日期过期',
|
||||
];
|
||||
//todo 插件商品类型应该用钩子获取
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,41 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\member_account;
|
||||
|
||||
|
||||
/**
|
||||
* 账户公共属性
|
||||
*/
|
||||
class AccountDict
|
||||
{
|
||||
const balance = 'balance';
|
||||
const balance_money = 'balance_money';
|
||||
const point = 'point';
|
||||
const growth = 'growth';
|
||||
|
||||
|
||||
/**
|
||||
* 账户类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::balance => '储值余额',
|
||||
self::balance_money => '现金余额',
|
||||
self::point => '积分',
|
||||
self::growth => '成长值'
|
||||
);
|
||||
if(!$type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\member_account;
|
||||
|
||||
|
||||
/**
|
||||
* 账户公共属性
|
||||
*/
|
||||
class AccountDict
|
||||
{
|
||||
const balance = 'balance';
|
||||
const balance_money = 'balance_money';
|
||||
const point = 'point';
|
||||
const growth = 'growth';
|
||||
|
||||
|
||||
/**
|
||||
* 账户类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::balance => '储值余额',
|
||||
self::balance_money => '现金余额',
|
||||
self::point => '积分',
|
||||
self::growth => '成长值'
|
||||
);
|
||||
if(!$type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
|
||||
/**
|
||||
* 订单公共属性
|
||||
*/
|
||||
class OrderDict
|
||||
{
|
||||
//普通订单
|
||||
const express = 1;
|
||||
const store = 2;
|
||||
const local = 3;
|
||||
const virtual = 4;
|
||||
|
||||
const cashier = 5;
|
||||
|
||||
/**
|
||||
* 订单类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::express => '物流订单',
|
||||
self::store => '自提订单',
|
||||
self::local => '外卖订单',
|
||||
self::virtual => '虚拟订单',
|
||||
self::cashier => '收银订单',
|
||||
];
|
||||
$temp_list = array_filter(event('GetOrderType'));
|
||||
if(!empty($temp_list)){
|
||||
foreach($temp_list as $k => $v){
|
||||
$list = array_merge($list, $v);
|
||||
}
|
||||
}
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const scene_online = 'online';
|
||||
const scene_cashier = 'cashier';
|
||||
|
||||
/**
|
||||
* 订单创建场景
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getOrderScene($type = ''){
|
||||
$list = [
|
||||
self::scene_online => '线上订单',
|
||||
self::scene_cashier => '自收银台订单',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const evaluate_wait = 0;
|
||||
const evaluated = 1;
|
||||
const evaluate_again = 2;
|
||||
/**
|
||||
* 订单评价状态
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getEvaluateStatus($status = ''){
|
||||
$list = [
|
||||
self::evaluate_wait => '待评价',
|
||||
self::evaluated => '已评价',
|
||||
self::evaluate_again => '已追评',
|
||||
];
|
||||
if($status !== '') return $list[$status] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
|
||||
/**
|
||||
* 订单公共属性
|
||||
*/
|
||||
class OrderDict
|
||||
{
|
||||
//普通订单
|
||||
const express = 1;
|
||||
const store = 2;
|
||||
const local = 3;
|
||||
const virtual = 4;
|
||||
|
||||
const cashier = 5;
|
||||
|
||||
/**
|
||||
* 订单类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::express => '物流订单',
|
||||
self::store => '自提订单',
|
||||
self::local => '外卖订单',
|
||||
self::virtual => '虚拟订单',
|
||||
self::cashier => '收银订单',
|
||||
];
|
||||
$temp_list = array_filter(event('GetOrderType'));
|
||||
if(!empty($temp_list)){
|
||||
foreach($temp_list as $k => $v){
|
||||
$list = array_merge($list, $v);
|
||||
}
|
||||
}
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const scene_online = 'online';
|
||||
const scene_cashier = 'cashier';
|
||||
|
||||
/**
|
||||
* 订单创建场景
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getOrderScene($type = ''){
|
||||
$list = [
|
||||
self::scene_online => '线上订单',
|
||||
self::scene_cashier => '自收银台订单',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
const evaluate_wait = 0;
|
||||
const evaluated = 1;
|
||||
const evaluate_again = 2;
|
||||
/**
|
||||
* 订单评价状态
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getEvaluateStatus($status = ''){
|
||||
$list = [
|
||||
self::evaluate_wait => '待评价',
|
||||
self::evaluated => '已评价',
|
||||
self::evaluate_again => '已追评',
|
||||
];
|
||||
if($status !== '') return $list[$status] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
|
||||
/**
|
||||
* 订单项公共属性
|
||||
*/
|
||||
class OrderGoodsDict
|
||||
{
|
||||
const wait_delivery = 0;//待发货
|
||||
|
||||
const delivery = 1;//已发货
|
||||
|
||||
const delivery_finish = 2;
|
||||
|
||||
/**
|
||||
* 作用于订单项上的配送状态
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getDeliveryStatus($status = ''){
|
||||
$list = array(
|
||||
self::wait_delivery => '待发货',
|
||||
self::delivery => '已发货',
|
||||
self::delivery_finish => '已收货'
|
||||
);
|
||||
if($status !== '') return $list[$status] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
|
||||
/**
|
||||
* 订单项公共属性
|
||||
*/
|
||||
class OrderGoodsDict
|
||||
{
|
||||
const wait_delivery = 0;//待发货
|
||||
|
||||
const delivery = 1;//已发货
|
||||
|
||||
const delivery_finish = 2;
|
||||
|
||||
/**
|
||||
* 作用于订单项上的配送状态
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getDeliveryStatus($status = ''){
|
||||
$list = array(
|
||||
self::wait_delivery => '待发货',
|
||||
self::delivery => '已发货',
|
||||
self::delivery_finish => '已收货'
|
||||
);
|
||||
if($status !== '') return $list[$status] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
|
||||
/**
|
||||
* 订单支付公共属性
|
||||
*/
|
||||
class OrderPayDict
|
||||
{
|
||||
const online_pay = 'ONLINE_PAY';
|
||||
const balance = 'BALANCE';
|
||||
const offline_pay = 'OFFLINE_PAY';
|
||||
const point = 'POINT';
|
||||
|
||||
/**
|
||||
* 订单支付方式
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::online_pay => '在线支付',
|
||||
self::balance => '余额支付',
|
||||
self::offline_pay => '线下支付',
|
||||
self::point => '积分兑换',
|
||||
);
|
||||
$list = array_merge($list, PayDict::getType());
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\order;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
|
||||
/**
|
||||
* 订单支付公共属性
|
||||
*/
|
||||
class OrderPayDict
|
||||
{
|
||||
const online_pay = 'ONLINE_PAY';
|
||||
const balance = 'BALANCE';
|
||||
const offline_pay = 'OFFLINE_PAY';
|
||||
const offline_pay2 = 'offlinepay';
|
||||
const point = 'POINT';
|
||||
|
||||
/**
|
||||
* 订单支付方式
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::online_pay => '在线支付',
|
||||
self::balance => '余额支付',
|
||||
self::offline_pay => '线下支付',
|
||||
self::offline_pay2 => '线下支付',
|
||||
self::point => '积分兑换',
|
||||
);
|
||||
$list = array_merge($list, PayDict::getType());
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,277 +1,284 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\order_refund;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单公共属性
|
||||
*/
|
||||
class OrderRefundDict
|
||||
{
|
||||
/********************************************************************************* 订单退款状态 *****************************************************/
|
||||
//未申请退款
|
||||
const REFUND_NOT_APPLY = 0;
|
||||
|
||||
//已申请退款
|
||||
const REFUND_APPLY = 1;
|
||||
|
||||
// 已确认
|
||||
const REFUND_CONFIRM = 2;
|
||||
|
||||
//已完成
|
||||
const REFUND_COMPLETE = 3;
|
||||
|
||||
//等待买家发货
|
||||
const REFUND_WAIT_DELIVERY = 4;
|
||||
|
||||
//等待卖家收货
|
||||
const REFUND_WAIT_TAKEDELIVERY = 5;
|
||||
//卖家确认收货
|
||||
const REFUND_TAKEDELIVERY = 6;
|
||||
|
||||
// 卖家拒绝退款
|
||||
const REFUND_DIEAGREE = -1;
|
||||
|
||||
// 卖家关闭退款
|
||||
const REFUND_CLOSE = -2;
|
||||
|
||||
//退款方式
|
||||
const ONLY_REFUNDS = 1;//仅退款
|
||||
const A_REFUND_RETURN = 2;//退款退货
|
||||
const SHOP_ACTIVE_REFUND = 3;//店铺主动退款
|
||||
|
||||
/******************** 退款模式 ****************/
|
||||
const refund = 1;
|
||||
const after_sales = 2;
|
||||
/**
|
||||
* 退款类型
|
||||
* @return void
|
||||
*/
|
||||
public static function getRefundMode($type = ''){
|
||||
$list = [
|
||||
self::refund => '退款',
|
||||
self::after_sales => '售后',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 维权状态以及操作
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getStatus($status = 'all'){
|
||||
$list = [
|
||||
self::REFUND_NOT_APPLY => [
|
||||
'status' => self::REFUND_NOT_APPLY,
|
||||
'name' => '',
|
||||
'action' => [
|
||||
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundApply',
|
||||
'title' => '申请维权',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_APPLY => [
|
||||
'status' => self::REFUND_APPLY,
|
||||
'name' => '申请维权',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundAgree',
|
||||
'title' => '同意',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundRefuse',
|
||||
'title' => '拒绝',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundCancel',
|
||||
'title' => '撤销维权',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_CONFIRM => [
|
||||
'status' => self::REFUND_CONFIRM,
|
||||
'name' => '待转账',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTransfer',
|
||||
'title' => '转账',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_COMPLETE => [
|
||||
'status' => self::REFUND_COMPLETE,
|
||||
'name' => '维权结束',
|
||||
'action' => [
|
||||
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_WAIT_DELIVERY => [
|
||||
'status' => self::REFUND_WAIT_DELIVERY,
|
||||
'name' => '买家待退货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundDelivery',
|
||||
'title' => '填写发货物流',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_WAIT_TAKEDELIVERY => [
|
||||
'status' => self::REFUND_WAIT_TAKEDELIVERY,
|
||||
'name' => '卖家待收货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTakeDelivery',
|
||||
'title' => '收货',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundRefuse',
|
||||
'title' => '拒绝',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_TAKEDELIVERY => [
|
||||
'status' => self::REFUND_TAKEDELIVERY,
|
||||
'name' => '卖家已收货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTransfer',
|
||||
'title' => '转账',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_DIEAGREE => [
|
||||
'status' => self::REFUND_DIEAGREE,
|
||||
'name' => '卖家拒绝',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundCancel',
|
||||
'title' => '撤销维权',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundAsk',
|
||||
'title' => '修改申请',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
if((string)$status != 'all') {
|
||||
return $list[$status] ?? [];
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维权方式
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getRefundType(){
|
||||
$list = [
|
||||
self::ONLY_REFUNDS => '仅退款',
|
||||
self::A_REFUND_RETURN => '退货退款',
|
||||
];
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 维权原因
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getRefundReasonType(){
|
||||
$list = [
|
||||
'未按约定时间发货',
|
||||
'拍错/多拍/不喜欢',
|
||||
'协商一致退款',
|
||||
'其他',
|
||||
];
|
||||
return $list;
|
||||
}
|
||||
|
||||
const back = 1;
|
||||
const offline = 2;
|
||||
const balance = 3;
|
||||
public static function getRefundMoneyType($type = ''){
|
||||
$list = [
|
||||
self::back => '原路退款',
|
||||
self::offline => '线下',
|
||||
self::balance => '余额',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\order_refund;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单公共属性
|
||||
*/
|
||||
class OrderRefundDict
|
||||
{
|
||||
/********************************************************************************* 订单退款状态 *****************************************************/
|
||||
//未申请退款
|
||||
const REFUND_NOT_APPLY = 0;
|
||||
|
||||
//已申请退款
|
||||
const REFUND_APPLY = 1;
|
||||
|
||||
// 已确认
|
||||
const REFUND_CONFIRM = 2;
|
||||
|
||||
//已完成
|
||||
const REFUND_COMPLETE = 3;
|
||||
|
||||
//等待买家发货
|
||||
const REFUND_WAIT_DELIVERY = 4;
|
||||
|
||||
//等待卖家收货
|
||||
const REFUND_WAIT_TAKEDELIVERY = 5;
|
||||
//卖家确认收货
|
||||
const REFUND_TAKEDELIVERY = 6;
|
||||
|
||||
// 卖家拒绝退款
|
||||
const REFUND_DIEAGREE = -1;
|
||||
|
||||
// 卖家关闭退款
|
||||
const REFUND_CLOSE = -2;
|
||||
|
||||
//部分退款
|
||||
const PARTIAL_REFUND = -3;
|
||||
|
||||
//退款方式
|
||||
const ONLY_REFUNDS = 1;//仅退款
|
||||
const A_REFUND_RETURN = 2;//退款退货
|
||||
const SHOP_ACTIVE_REFUND = 3;//店铺主动退款
|
||||
public static function getRefundType($type = ''){
|
||||
$list = [
|
||||
self::ONLY_REFUNDS => '仅退款',
|
||||
self::A_REFUND_RETURN => '退款退货',
|
||||
];
|
||||
if($type !== '') return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
/******************** 退款模式 ****************/
|
||||
const refund = 1;
|
||||
const after_sales = 2;
|
||||
/**
|
||||
* 退款类型
|
||||
* @return void
|
||||
*/
|
||||
public static function getRefundMode($type = ''){
|
||||
$list = [
|
||||
self::refund => '退款',
|
||||
self::after_sales => '售后',
|
||||
];
|
||||
if($type !== '') return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 维权状态以及操作
|
||||
* @param $status
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getStatus($status = 'all'){
|
||||
$list = [
|
||||
self::REFUND_NOT_APPLY => [
|
||||
'status' => self::REFUND_NOT_APPLY,
|
||||
'name' => '',
|
||||
'action' => [
|
||||
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundApply',
|
||||
'title' => '申请售后',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_APPLY => [
|
||||
'status' => self::REFUND_APPLY,
|
||||
'name' => '申请售后',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundAgree',
|
||||
'title' => '同意',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundRefuse',
|
||||
'title' => '拒绝',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭维权',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundCancel',
|
||||
'title' => '撤销售后',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_CONFIRM => [
|
||||
'status' => self::REFUND_CONFIRM,
|
||||
'name' => '待转账',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTransfer',
|
||||
'title' => '转账',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭售后',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_COMPLETE => [
|
||||
'status' => self::REFUND_COMPLETE,
|
||||
'name' => '售后结束',
|
||||
'action' => [
|
||||
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_WAIT_DELIVERY => [
|
||||
'status' => self::REFUND_WAIT_DELIVERY,
|
||||
'name' => '买家待退货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭售后',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundDelivery',
|
||||
'title' => '填写发货物流',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::REFUND_WAIT_TAKEDELIVERY => [
|
||||
'status' => self::REFUND_WAIT_TAKEDELIVERY,
|
||||
'name' => '卖家待收货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTakeDelivery',
|
||||
'title' => '收货',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundRefuse',
|
||||
'title' => '拒绝',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭售后',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_TAKEDELIVERY => [
|
||||
'status' => self::REFUND_TAKEDELIVERY,
|
||||
'name' => '卖家已收货',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundTransfer',
|
||||
'title' => '转账',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭售后',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
|
||||
]
|
||||
],
|
||||
self::REFUND_DIEAGREE => [
|
||||
'status' => self::REFUND_DIEAGREE,
|
||||
'name' => '卖家拒绝',
|
||||
'action' => [
|
||||
[
|
||||
'event' => 'orderRefundClose',
|
||||
'title' => '关闭售后',
|
||||
'color' => ''
|
||||
]
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundCancel',
|
||||
'title' => '撤销售后',
|
||||
'color' => ''
|
||||
],
|
||||
[
|
||||
'event' => 'orderRefundAsk',
|
||||
'title' => '修改申请',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
self::PARTIAL_REFUND => [
|
||||
'status' => self::PARTIAL_REFUND,
|
||||
'name' => '部分退款',
|
||||
'action' => [
|
||||
|
||||
],
|
||||
'member_action' => [
|
||||
[
|
||||
'event' => 'orderRefundApply',
|
||||
'title' => '申请售后',
|
||||
'color' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
if((string)$status != 'all') {
|
||||
return $list[$status] ?? [];
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 售后原因
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getRefundReasonType($site_id = 1){
|
||||
/*$list = [
|
||||
'未按约定时间发货',
|
||||
'拍错/多拍/不喜欢',
|
||||
'协商一致退款',
|
||||
'其他',
|
||||
];*/
|
||||
$config_model = new \app\model\order\Config();
|
||||
$config_info = $config_model->getOrderRefundConfig($site_id)['data']['value'];
|
||||
$reason_type = explode("\n", $config_info['reason_type']);
|
||||
return $reason_type;
|
||||
}
|
||||
|
||||
const back = 1;
|
||||
const offline = 2;
|
||||
const balance = 3;
|
||||
public static function getRefundMoneyType($type = ''){
|
||||
$list = [
|
||||
self::back => '原路退款',
|
||||
self::offline => '线下退款',
|
||||
self::balance => '退款到余额',
|
||||
];
|
||||
if($type !== '') return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\pay;
|
||||
|
||||
/**
|
||||
* 支付公共属性
|
||||
*/
|
||||
class PayDict
|
||||
{
|
||||
//普通订单
|
||||
const wechatpay = 'wechatpay';
|
||||
const alipay = 'alipay';
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::wechatpay => '微信支付',
|
||||
self::alipay => '支付宝支付',
|
||||
);
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\pay;
|
||||
|
||||
/**
|
||||
* 支付公共属性
|
||||
*/
|
||||
class PayDict
|
||||
{
|
||||
//普通订单
|
||||
const wechatpay = 'wechatpay';
|
||||
const alipay = 'alipay';
|
||||
const huaweipay = 'huaweipay';
|
||||
|
||||
/**
|
||||
* 支付方式
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = array(
|
||||
self::wechatpay => '微信支付',
|
||||
self::alipay => '支付宝支付',
|
||||
self::huaweipay => '华为支付',
|
||||
);
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,72 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
namespace app\dict\system;
|
||||
|
||||
|
||||
/**
|
||||
* 计划任务属性
|
||||
*/
|
||||
class ScheduleDict
|
||||
{
|
||||
const default = 'default';
|
||||
const url = 'url';
|
||||
const cli = 'cli';
|
||||
|
||||
/**
|
||||
* 计划任务类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::default => '系统任务',
|
||||
self::url => '接口启动',
|
||||
self::cli => '命令启动',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误列表
|
||||
* @param $code
|
||||
* @return void
|
||||
*/
|
||||
public static function getError($code = ''){
|
||||
$list = array(
|
||||
self::default => [
|
||||
'curl_ssl_error' => '',
|
||||
],
|
||||
self::url => [
|
||||
|
||||
],
|
||||
self::cli => [
|
||||
|
||||
],
|
||||
);
|
||||
if($code) return $list[$code] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function getSuggestion(string $type) {
|
||||
switch($type) {
|
||||
case self::default:
|
||||
return '请检查系统计划任务配置,确保 cron 进程正常运行,并检查网络连接和 SSL 证书设置。';
|
||||
case self::url:
|
||||
return '请检查网络连接、目标 URL 可访问性、HTTP 状态码和接口认证配置。可以使用 curl 命令手动测试接口。';
|
||||
case self::cli:
|
||||
return '请检查 cron 服务状态、命令执行权限、脚本路径和 PHP CLI 环境。建议使用 crontab -l 查看当前任务配置。';
|
||||
default:
|
||||
return '请检查计划任务配置文件和相关权限设置,确保所有依赖服务正常运行。';
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace app\dict\system;
|
||||
|
||||
|
||||
/**
|
||||
* 计划任务属性
|
||||
*/
|
||||
class ScheduleDict
|
||||
{
|
||||
const default = 'default';
|
||||
const url = 'url';
|
||||
const cli = 'cli';
|
||||
|
||||
/**
|
||||
* 计划任务类型
|
||||
* @param $type
|
||||
* @return string|string[]
|
||||
*/
|
||||
public static function getType($type = ''){
|
||||
$list = [
|
||||
self::default => '系统任务',
|
||||
self::url => '接口启动',
|
||||
self::cli => '命令启动',
|
||||
];
|
||||
if($type) return $list[$type] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取错误列表
|
||||
* @param $code
|
||||
* @return void
|
||||
*/
|
||||
public static function getError($code = ''){
|
||||
$list = array(
|
||||
self::default => [
|
||||
'curl_ssl_error' => '',
|
||||
],
|
||||
self::url => [
|
||||
|
||||
],
|
||||
self::cli => [
|
||||
|
||||
],
|
||||
);
|
||||
if($code) return $list[$code] ?? '';
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function getSuggestion(string $type) {
|
||||
switch($type) {
|
||||
case self::default:
|
||||
return '请检查系统计划任务配置,确保 cron 进程正常运行,并检查网络连接和 SSL 证书设置。';
|
||||
case self::url:
|
||||
return '请检查网络连接、目标 URL 可访问性、HTTP 状态码和接口认证配置。可以使用 curl 命令手动测试接口。';
|
||||
case self::cli:
|
||||
return '请检查 cron 服务状态、命令执行权限、脚本路径和 PHP CLI 环境。建议使用 crontab -l 查看当前任务配置。';
|
||||
default:
|
||||
return '请检查计划任务配置文件和相关权限设置,确保所有依赖服务正常运行。';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user