glhcp/server/app/common/enum/GoodsEnum.php

102 lines
3.0 KiB
PHP
Raw Normal View History

2023-08-10 06:59:52 +00:00
<?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 GoodsEnum
{
// 商品类型
const TYPE_ACTUAL = 0; // 实物商品
const TYPE_VIRTUAL = 1; // 虚拟商品
/**
* 运费类型
*/
const EXPRESS_TYPE_FREE = 1; //包邮
const EXPRESS_TYPE_UNIFIED = 2; //统一运费
const EXPRESS_TYPE_TEMPLATE = 3; //运费模板
/**
* 销售状态
*/
const STATUS_SOLD_OUT = 0; //仓库中
const STATUS_SHELVES = 1; //上架中
/**
* 删除状态
*/
const DEL_NORMAL = 0; // 正常
const DEL_TRUE = 1; // 已删除
const DEL_RECYCLE = 2; // 回收站
/**
* 审核状态
*/
const AUDIT_STATUS_STAY = 0; //待审核
const AUDIT_STATUS_OK = 1; //审核通过
const AUDIT_STATUS_REFUSE = 2; //审核失败
/**
* 商品类型
*/
const SALES = 1; // 销售中
const WAREHOUSE = 2; // 仓库中
const WARNING = 3; // 库存预警
const RECYCLE_BIN = 4; // 回收站
const WAIT_AUDIT = 5; // 待审核
const UNPASS_AUDIT = 6; // 未通过审核
/**
* 配送方式
*/
const DELIVERY_EXPRESS = 1;// 快递发货
const DELIVERY_VIRTUAL = 2;// 虚拟发货
// 买家付款后
const AFTER_PAY_AUTO_DELIVERY = 1;// 自动发货
const AFTER_PAY_SELF_DELIVERY = 2;// 手动发货
// 卖家发货后
const AFTER_DELIVERY_AUTO_COMFIRM = 1;// 自动完成订单
const AFTER_DELIVERY_SELF_COMFIRM = 2;// 买家确认订单
/**
* @notes 商品类型
* @param bool $type
* @return string|string[]
* @author 段誉
* @date 2022/4/20 18:38
*/
public static function getTypeDesc($type = true)
{
$desc = [
self::TYPE_ACTUAL => '实物商品',
self::TYPE_VIRTUAL => '虚拟商品',
];
if ($type === true) {
return $desc;
}
return $desc[$type] ?? '';
}
}