初始化项目:添加后端代码、ThinkPHP框架、前端资源

This commit is contained in:
amb
2026-09-03 12:42:39 +08:00
commit 482bece22e
3726 changed files with 416708 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
<?php
namespace app\api\model\app\vip;
use think\Model;
use think\Db;
use app\common\model\User;
use app\api\model\app\vip\CardUser;
class Card extends Model
{
// 表名
protected $name = 'app_vip_card';
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $hidden = ['createtime', 'updatetime'];
// 追加属性
protected $append = [
];
/**
* 获取订单中的会员卡与规格对应的信息
* @param $cardIdSku 格式 ID_SKU
* @return false
*/
public static function getPayDetail($cardIdSku){
$cardId = explode("_",$cardIdSku);
$data = self::where([
'id'=>$cardId[0],
'status'=>1
])->find();
if(!$data){
return false;
}
$data['sku'] = json_decode($data['sku'],true);
if(!$data['sku'] || !isset($cardId[1]) || !isset($data['sku'][$cardId[1]])){
return false;
}
$data['price_marking'] = $data['price'] = $data['sku'][$cardId[1]]['price']; //价格
$data['time'] = $data['sku'][$cardId[1]]['time']; //时长
$data['limit'] = $data['sku'][$cardId[1]]['limit']; //限购
$data['name'] = $data['title'];
$data['type'] = 'vipcard';
if(\app\common\library\Platform::getSystemType() == 'single'){
$data['cover'] = MODULE_URL.'/assets/image/vipcard.png';
}else{
$data['cover'] = MODULE_URL.'/public/assets/image/vipcard.png';
}
return $data;
}
}