巡乐会抽奖接口提交.-联调-盘-bug修改 盲盒转盘礼物补发时间改为30分钟内

This commit is contained in:
2025-09-05 11:13:19 +08:00
parent 612f48402d
commit d69a1ca9bb
2 changed files with 26 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ namespace app\adminapi\controller;
use app\admin\model\AdminLog;
use app\common\controller\Upload;
use Overtrue\Pinyin\Pinyin;
use think\Request;
/**
@@ -32,7 +33,25 @@ class UploadFile extends Upload
try {
// 获取临时路径和原始文件名
$filePath = $file->getRealPath();
$objectName = $file->getInfo('name');
$originalName = $file->getInfo('name');
// 提取文件扩展名
$extension = pathinfo($originalName, PATHINFO_EXTENSION);
// 处理文件名(中文转拼音)
$fileName = $originalName;
if (preg_match('/[\x{4e00}-\x{9fa5}]+/u', $fileName)) {
$pinyin = new Pinyin();
$fileName = $pinyin->permalink($fileName, ''); // 转换为无分隔符的拼音
}
// 移除扩展名(如果有的话)
$fileName = pathinfo($fileName, PATHINFO_FILENAME);
// 添加唯一标识符(时间戳+随机数)
$uniqueId = time() . mt_rand(1000, 9999);
$objectName = $fileName . '_' . $uniqueId . '.' . $extension;
// 调用父类方法上传到 OSS
$result = $this->uploadFile($objectName, $filePath);
if (!$result) {

View File

@@ -561,21 +561,22 @@ class BlindBoxTurntableGift extends Model
if($gift_bag_detail['foreign_id'] == $ext['locking_condition']['selected_gift_id']){
//中奖
$pan_xlh_num = $pan_xlh_num+1;
$cache_key = 'selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id'];
if($pan_xlh_num <= 1){
$add_end_time = $ext['locking_time']['tow_no_locking_time'] * 60;
Cache::set('selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id'],$add_end_time,$add_end_time);
Cache::set($cache_key,$add_end_time,$add_end_time);
}else{
// $add_end_time = ($ext['locking_time']['tow_no_locking_time']-$ext['locking_time']['next_time']) * 60;
if(Cache::get('selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id'])){
$erci_xlh_num = Cache::get('selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id']);
if(Cache::get($cache_key)){
$erci_xlh_num = Cache::get($cache_key);
$add_end_time = ($erci_xlh_num-$ext['locking_time']['next_time'] *60);
Cache::set('selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id'],$add_end_time,$add_end_time);
Cache::set($cache_key,$add_end_time,$add_end_time);
}else{
$add_end_time = ($ext['locking_time']['tow_no_locking_time']-$ext['locking_time']['next_time']) * 60;
}
}
if($add_end_time <= 30){
Cache::set('selected_gift_id_'.$room_id.$gift_bag_detail['foreign_id'],30,30);
Cache::set($cache_key,30,30);
$add_end_time = 30;
}
$end_time = time() + $add_end_time;