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,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;
}
}