初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
+83
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constant\cache;
|
||||
|
||||
/**
|
||||
* 缓存keys
|
||||
*/
|
||||
class Keys
|
||||
{
|
||||
//\app\common\constant\cache\Keys::LIVE_ROOM_CONFIG
|
||||
|
||||
const APP_CONFIG = 'app_config'; // APP 配置
|
||||
|
||||
|
||||
const STUDY_LOG_CACHE_KEYS = 'study:log:keys'; // 学习记录keys
|
||||
|
||||
const STUDY_LOG = 'study:log:'; // 学习记录缓存
|
||||
|
||||
const LIVE_USER = 'live:user:'; // 直播观众
|
||||
|
||||
|
||||
const LIVE_ROOM_CONFIG = 'live:room:config:'; // 直播间配置
|
||||
|
||||
const PAGE_NAVIGATION = 'page:navigation'; // 底部导航缓存
|
||||
|
||||
const PAGE_INDEX = 'page:index'; // 自定义页面-首页
|
||||
|
||||
const PAGE_OTHER = 'page:other:'; // 自定义页面-其他页面
|
||||
|
||||
const PAGE_TAG = 'page:tag'; // 自定义页面-标签 用于批量管理
|
||||
|
||||
const VOD_TAG = 'vod:tag'; // 自定义页面-标签 用于批量管理
|
||||
|
||||
const PAGE_COURSE = 'page:course:'; // 自定义页面-获取课程-数据
|
||||
|
||||
const PAGE_PHYSICAL_GOODS = 'page:physical_goods:'; // 自定义页面-获取实物商品-数据
|
||||
|
||||
const COURSE_TAG = 'course:tag'; // 课程-标签 用于批量管理
|
||||
|
||||
const COURSE_RECOMMEND = 'course:recommend'; // 课程-推荐商品
|
||||
|
||||
const COURSE_BELONGS_COLUMN = 'course:belongs:column:'; // 课程-所属专栏
|
||||
|
||||
const RECORD_LOG = 'record:log';//app\api\controller\data\Record->log 记录日志
|
||||
|
||||
//自定义页面组件绑定的课程
|
||||
public static function PAGE_COURSE($type = 'ids',$goods=[],$length=10){
|
||||
return 'page:course:'.md5($type.json_encode($goods).$length);
|
||||
}
|
||||
|
||||
//自定义页面组件绑定的实物商品
|
||||
public static function PAGE_PHYSICAL_GOODS($type = 'ids',$goods=[],$length=10,$categoryIds=[]){
|
||||
return 'page:physical_goods:'.md5($type.json_encode($goods).$length.json_encode($categoryIds));
|
||||
}
|
||||
|
||||
public static function subscriptionAuthKey($userId, $courseId){
|
||||
return 'sub_auth_u_'.$userId."_course_".$courseId;
|
||||
}
|
||||
|
||||
public static function LIVEUSER($userId, $liveId){
|
||||
return 'live:user:u:'.$userId.":l:".$liveId;
|
||||
}
|
||||
|
||||
|
||||
public static function SYSTEM_CONFIG($name){
|
||||
return 'system_config:'.$name;
|
||||
}
|
||||
|
||||
public static function SYSTEM_CONFIG_CHECK($type,$name){
|
||||
return 'system_config_check:'.$type.':'.$name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 阿里云点播存储解析的播放地址
|
||||
* @param $vodId
|
||||
* @return string
|
||||
*/
|
||||
public static function VOD_PLAY_URL($vodId){
|
||||
return 'vod:play_url:'.$vodId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constant\cache;
|
||||
|
||||
/**
|
||||
* 缓存keys
|
||||
*/
|
||||
class Timeout
|
||||
{
|
||||
//\app\common\constant\cache\Timeout::COURSE_RECOMMEND
|
||||
|
||||
const STUDY_LOG_CACHE_SYNC = 180; //学习记录数据缓存有效时间
|
||||
|
||||
const PAGE_COURSE = 180;//自定义页面组件绑定的课程缓存有效时间
|
||||
|
||||
const COURSE_RECOMMEND = 180; // 课程-推荐商品
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constant\course;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
class Subscription
|
||||
{
|
||||
//订阅时间 永久
|
||||
const VALIDITY_ETERNITY = 9999999999;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\constant\order;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
class Status
|
||||
{
|
||||
//订单状态
|
||||
const STATUS_CLOSE = 'close';//已关闭
|
||||
const STATUS_UNPAID = 'unpaid';//待支付
|
||||
const STATUS_PAID = 'paid';//已经支付
|
||||
const STATUS_UNRECEIVE = 'unreceive';//待收货;已发货
|
||||
const STATUS_UNSEND = 'unsend';//待发货
|
||||
const STATUS_SUREUNRECEIVE = 'surereceive';//确认收货
|
||||
const STATUS_SUCCESS = 'success';//交易成功
|
||||
const STATUS_CANCEL = 'cancel';//已取消
|
||||
const STATUS_SERVICE = 'service';//售后处理
|
||||
const STATUS_REFUND = 'refund';//已退款
|
||||
|
||||
|
||||
// 退款状态
|
||||
const REFUND_STATUS_REFUSE = -1; // 拒绝退款
|
||||
const REFUND_STATUS_NOREFUND = 0; // 退款状态 未申请
|
||||
const REFUND_STATUS_ING = 1; // 申请中
|
||||
const REFUND_STATUS_OK = 2; // 已同意
|
||||
const REFUND_STATUS_FINISH = 3; // 退款完成
|
||||
|
||||
// 售后状态
|
||||
const AFTERSALE_STATUS_NOAFTER = 0; // 未申请
|
||||
const AFTERSALE_STATUS_AFTERING = 1; // 申请退款
|
||||
const AFTERSALE_STATUS_OK = 2; // 售后完成
|
||||
|
||||
//退款申请状态
|
||||
const REFUND_APPLY_STATUS_WAITING = 0;//未处理
|
||||
const REFUND_APPLY_STATUS_OK = 0;//已处理
|
||||
|
||||
public static function getSuccessOrderStatus(){
|
||||
return [self::STATUS_PAID,self::STATUS_UNRECEIVE,self::STATUS_UNSEND,self::STATUS_SUREUNRECEIVE,self::STATUS_SUCCESS];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user