Files
anmo/server/app/common/enum/OrderEnum.php
2025-08-19 14:16:51 +08:00

132 lines
4.0 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | likeshop开源商城系统
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | gitee下载https://gitee.com/likeshop_gitee
// | github下载https://github.com/likeshop-github
// | 访问官网https://www.likeshop.cn
// | 访问社区https://home.likeshop.cn
// | 访问手册http://doc.likeshop.cn
// | 微信公众号likeshop技术社区
// | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用未经许可不能去除前后端官方版权标识
// | likeshop系列产品收费版本务必购买商业授权购买去版权授权后方可去除前后端官方版权标识
// | 禁止对系统程序代码以任何目的,任何形式的再发布
// | likeshop团队版权所有并拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeshop.cn.team
// +----------------------------------------------------------------------
namespace app\common\enum;
class OrderEnum
{
//订单状态
const ORDER_STATUS_WAIT_PAY = 0; //待支付
const ORDER_STATUS_WAIT_RECEIVING = 1; //待接单
const ORDER_STATUS_WAIT_DEPART = 2; //待出发
const ORDER_STATUS_DEPART = 3; //已出发
const ORDER_STATUS_ARRIVE = 4; //已到达
const ORDER_STATUS_START_SERVER = 5; //服务开始
const ORDER_STATUS_SERVER_FINISH = 6; //服务完成
const ORDER_STATUS_CLOSE = 7; //服务关闭
const TRIP_WAY_TAXI = 1;
const TRIP_WAY_BUS = 2;
//核销状态
const WAIT_VERIFICATION = 0;//待核销
const VERIFICATION = 1;//已核销
//派单状态
const DISPATCH_NO = 0;//未派单
const DISPATCH_YES = 1;//已派单
/**
* @notes 获取出行方式
* @param $value
* @return string|string[]
* @author cjhao
* @date 2024/9/7 17:10
*/
public static function getTripWayDesc($value = true)
{
$data = [
self::TRIP_WAY_TAXI => '滴滴/出租车',
self::TRIP_WAY_BUS => '公交车/地铁',
];
if (true === $value) {
return $data;
}
return $data[$value];
}
/**
* @notes 订单状态
* @param bool $value
* @return string|string[]
* @author ljj
* @date 2022/2/11 11:03 上午
*/
public static function getOrderStatusDesc($value = true)
{
$data = [
self::ORDER_STATUS_WAIT_PAY => '待支付',
self::ORDER_STATUS_WAIT_RECEIVING => '待接单',
self::ORDER_STATUS_WAIT_DEPART => '待出发',
self::ORDER_STATUS_DEPART => '已出发',
self::ORDER_STATUS_ARRIVE => '已到达',
self::ORDER_STATUS_START_SERVER => '服务开始',
self::ORDER_STATUS_SERVER_FINISH => '服务完成',
self::ORDER_STATUS_CLOSE => '已关闭',
];
if (true === $value) {
return $data;
}
return $data[$value];
}
/**
* @notes 核销状态
* @param bool $value
* @return string|string[]
* @author ljj
* @date 2021/8/26 4:29 下午
*/
public static function getVerificationStatusDesc($value = true)
{
$data = [
self::WAIT_VERIFICATION => '待核销',
self::VERIFICATION => '已核销',
];
if (true === $value) {
return $data;
}
return $data[$value];
}
/**
* @notes 派单状态
* @param bool $value
* @return string|string[]
* @author ljj
* @date 2022/8/29 4:56 下午
*/
public static function getDispatchDesc($value = true)
{
$data = [
self::DISPATCH_NO => '未派单',
self::DISPATCH_YES => '已派单',
];
if (true === $value) {
return $data;
}
return $data[$value];
}
}