multi-store/app/common/enum/OrderEnum.php

229 lines
5.5 KiB
PHP

<?php
namespace app\common\enum;
class OrderEnum
{
/**
* 流水类型
* @USER_ORDER_PAY 用户订单支付
* @CASHIER_ORDER_PAY 收银台支付
* @CASHIER_CASH_ORDER_PAY 收银台现金支付
* @MERCHANT_ORDER_OBTAINS 商户订单获得
* @ORDER_HANDLING_FEES 订单手续费
* @MERCHANT_ORDER_PAY 商户订单支付
* @PLATFORM_ORDER_OBTAINS 平台订单获得
* @SUPPLIER_ORDER_OBTAINS 供应链订单获得
* @VIP_ORDER_OBTAINS 会员订单获得
* @VILLAGE_ORDER_OBTAINS 村长获得
* @BRIGADE_ORDER_OBTAINS 队长获得
* @OTHER_ORDER_OBTAINS 其他获得
* @PLATFORM_ORDER_PAY 平台订单支付
* @SYSTEM_SET 系统设置
* @OWN_GET 平台收入
* @ORDER_MARGIN 商户保证金
* @PURCHASE_FUNDS 采购款收银
*/
const USER_ORDER_PAY = 1;
const MERCHANT_ORDER_OBTAINS = 2;
const ORDER_HANDLING_FEES = 3;
const MERCHANT_ORDER_PAY = 4;
const PLATFORM_ORDER_OBTAINS = 5;
const SUPPLIER_ORDER_OBTAINS = 6;
const PLATFORM_ORDER_PAY = 7;
const SYSTEM_SET = 8;
const CASHIER_ORDER_PAY = 9;//微信条码
const CASHIER_CASH_ORDER_PAY = 10;
const ORDER_MARGIN = 11;
const VIP_ORDER_OBTAINS = 12;
const CASHIER_ORDER_ALI_PAY = 13;//支付宝条码
const VILLAGE_ORDER_OBTAINS = 14;
const BRIGADE_ORDER_OBTAINS = 15;
const OTHER_ORDER_OBTAINS = 16;
const CASHIER_FACE_PAY = 17;//现金收银
const PURCHASE_FUNDS = 18;//采购款收银
/**
* 收入支出类型
* @EXPENDITURE 支出
* @INCOME 收入
*/
const EXPENDITURE = 0;
const INCOME = 1;
//-----------------------物流状态-----------------------//
/**
* @RECEIVED_GOODS 已收货
*/
const RECEIVED_GOODS = 2;
/**
* @WAIT_EVALUATION 待评价
*/
const WAIT_EVALUATION = 3;
/**
* @WAIT_DELIVERY 待发货
*/
const WAIT_DELIVERY = 0;
/**
* @WAIT_RECEIVING 待收货
*/
const WAIT_RECEIVING = 1;
/**
* @ALREADY_REFUND 申请退款
*/
const ALREADY_REFUND = -1;
/**
* @RETURN_SUCCESS 退款成功
*/
const RETURN_SUCCESS = -2;
/**
* 核销
* @IS_OK 已核销
*/
const IS_OK = 1;
/**
* 回调订单相关
* @PAY 支付
* @IBACK 退款
*/
const PAY = 1;
const BACK = 0;
/**小程序下单**/
const ONLINE = [1,2];
const OFFLINE = [3];
/**
* 账户类型
* @USER 用户
* @MERCHANT 商户
* @PLATFORM 平台
* @SUPPLIER 供应链
* @SYSTEM 系统
*/
const USER = 0;
const MERCHANT = 1;
const PLATFORM = 2;
const SUPPLIER = 3;
const SYSTEM = 4;
/**
* 订单状态
* @CANCEL_ORDER 取消售后
*/
const REFUND_GOODS = -2;
const REFUND_PAY = 4;
const CANCEL_ORDER = 5;
//退款状态
const REFUND_STATUS_NO = 0;
const REFUND_STATUS_YES = 1;
const REFUND_STATUS_FINISH = 2;
const CANCEL_SALE = 3;
//判断资金流水是否余额支付
const BALANCE_PAYMEN_NO = 1;
/**
* @notes 获取支付类型
* @param bool $value
* @return string|string[]
* @author 段誉
* @date 2023/2/23 15:36
*/
public static function getFinancialType($value = true)
{
$data = [
self::USER_ORDER_PAY => '订单支付',
self::MERCHANT_ORDER_PAY => '商户订单支付',
self::PLATFORM_ORDER_PAY => '平台订单支付',
self::MERCHANT_ORDER_OBTAINS => '商户',
self::ORDER_HANDLING_FEES => '手续费',
self::PLATFORM_ORDER_OBTAINS => '平台',
self::SUPPLIER_ORDER_OBTAINS => '成本',
self::SYSTEM_SET => '平台设置',
self::VILLAGE_ORDER_OBTAINS => '村长',
self::BRIGADE_ORDER_OBTAINS=>'队长',
self::ORDER_MARGIN=>'保证金',
self::VIP_ORDER_OBTAINS=>'会员',
self::OTHER_ORDER_OBTAINS=>'其他',
];
if ($value === true) {
return $data;
}
return $data[$value] ?? '';
}
/**
* @notes 获取订单状态类型
*/
public static function getOrderType($value = true)
{
$data = [
self::RECEIVED_GOODS => '已收货',
self::WAIT_EVALUATION => '待评价',
self::WAIT_DELIVERY => '待发货',
self::WAIT_RECEIVING => '待收货',
self::RETURN_SUCCESS => '退货成功',
self::ALREADY_REFUND => '已退款',
];
if ($value === true) {
return $data;
}
return $data[$value] ?? '';
}
/**
* @notes 获取订单状态类型
*/
public static function refundStatus($value = true)
{
$data = [
self::REFUND_STATUS_NO => '未退款',
self::REFUND_STATUS_YES => '退款中',
self::REFUND_STATUS_FINISH => '已退款',
];
if ($value === true) {
return $data;
}
return $data[$value] ?? '';
}
/**
* @notes 获取订单状态类型
*/
public static function refundType($value = true)
{
$data = [
1 => '仅退款',
2 => '退款退货',
3 => '拒绝退款',
4 => '商品待退货',
5 => '退货待收货',
6 => '已退款',
];
if ($value === true) {
return $data;
}
return $data[$value] ?? '';
}
}