This commit is contained in:
2025-10-29 15:32:26 +08:00
parent d90614805b
commit b7462657cd
78921 changed files with 2753938 additions and 71 deletions

View File

@@ -0,0 +1,52 @@
<?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;
}
}

View File

@@ -0,0 +1,41 @@
<?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;
}
}

View File

@@ -0,0 +1,85 @@
<?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;
}
}

View File

@@ -0,0 +1,43 @@
<?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;
}
}

View File

@@ -0,0 +1,42 @@
<?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;
}
}

View File

@@ -0,0 +1,277 @@
<?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;
}
}

View File

@@ -0,0 +1,36 @@
<?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;
}
}

View File

@@ -0,0 +1,59 @@
<?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;
}
}