签约房-装扮-降身卡功能开发-个人装扮-降身卡使用

This commit is contained in:
2025-11-26 16:05:01 +08:00
parent b5501cd6e8
commit b42bc92366
3 changed files with 40 additions and 7 deletions

View File

@@ -189,7 +189,7 @@ class RoomPan
//发放
//抽中礼物落包
$res = [];
$res = model('api/UserGiftPack')->change_user_gift_pack($value['user_id'],$value['gift_id'],$value['num'],model('UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖发放");
$res = model('api/UserGiftPack')->change_user_gift_pack($value['user_id'],$value['gift_id'],$value['num'],model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖发放");
if ($res['code'] != 1) {
echo $res['msg']."\n";
continue;
@@ -199,7 +199,7 @@ class RoomPan
$res = [];
//获取房主id
$user_id = db::name('vs_room')->where(['id'=>$value['room_id']])->value('user_id');
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放");
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放");
if ($res['code'] != 1) {
echo $res['msg']."\n";
continue;

View File

@@ -2,6 +2,8 @@
namespace app\cron\controller;
use app\common\controller\Push;
use think\Cache;
use think\Db;
use Yzh\YunPay;
@@ -10,7 +12,7 @@ use Yzh\YunPay;
*/
class Test
{
/*
/* https://vespa.qxyushen.top/api/Cron/Test
* 运行函数
*/
function index()
@@ -18,7 +20,8 @@ class Test
// 设置脚本执行时间无限
set_time_limit(0);
echo "统计盲盒转盘错误数据\n";
$this->blind_box_error();
// $this->blind_box_error();
$this->xlh_gift_send();
echo "\n";
}
@@ -155,4 +158,34 @@ class Test
var_dump($arr);
}
/*
* 巡乐会中奖后房主礼物补发放
*/
public function xlh_gift_send(){
die("暂停");
echo "开始补发巡乐会中奖后房主礼物 \n";
$xlh_list = db::name('vs_room_pan_xlh')->where(['id'=>['in',[279]]])->select();
echo "共有".count($xlh_list)."个需要发放的礼物 \n";
if(empty($xlh_list)){
echo "没有需要发放的礼物 \n";
}
foreach ($xlh_list as $key=>$value){
try{
//发放
//房主礼物落包
$res = [];
//获取房主id
$user_id = db::name('vs_room')->where(['id'=>$value['room_id']])->value('user_id');
$res = model('api/UserGiftPack')->change_user_gift_pack($user_id,$value['homeowner_gift_id'],1,model('api/UserGiftPack')::XLH_DRAW_GIFT_GET,"巡乐会中奖后房主礼物发放-补发");
if ($res['code'] != 1) {
echo $res['msg']."\n";
continue;
}
echo "巡乐会中奖后房主礼物发放成功 房主Id".$user_id."\n";
}catch (\Exception $e){
echo $e->getMessage()."\n";
}
}
}
}