From b42bc923662142671041890f71df08989a94d308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Wed, 26 Nov 2025 16:05:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E7=BA=A6=E6=88=BF-=E8=A3=85=E6=89=AE-?= =?UTF-8?q?=E9=99=8D=E8=BA=AB=E5=8D=A1=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= =?UTF-8?q?-=E4=B8=AA=E4=BA=BA=E8=A3=85=E6=89=AE-=E9=99=8D=E8=BA=AB?= =?UTF-8?q?=E5=8D=A1=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Decorate.php | 6 ++-- application/cron/controller/RoomPan.php | 4 +-- application/cron/controller/Test.php | 37 +++++++++++++++++++++++-- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/application/api/model/Decorate.php b/application/api/model/Decorate.php index 26c1f08..0530830 100644 --- a/application/api/model/Decorate.php +++ b/application/api/model/Decorate.php @@ -384,7 +384,7 @@ class Decorate extends Model Db::commit(); if($info['type'] == 12){ //使用降身卡,降低用户身价 - $reduce_ratio = db::name('vs_decorate')->where(['did' => $info['did']])->value('reduce_ratio') ?? 0; + $reduce_ratio = db::name('vs_decorate')->where(['did' => $info['did']])->value('ext_value') ?? 0; $market_value = db::name('user')->where(['id' => $uid])->value('market_value'); if($reduce_ratio){ $reduce_market_value = $market_value * $reduce_ratio / 100; @@ -399,9 +399,9 @@ class Decorate extends Model db::name('user')->where(['id' => $uid])->update(['market_value' => $up_market_value]); //记录一条日志 db::name('vs_user_market_value_log')->insert([ - 'user id' => $uid, + 'user_id' => $uid, 'before' => $market_value, - 'change value'=> $reduce_market_value, + 'change_value'=> $reduce_market_value, 'afterwards'=> $up_market_value, 'type' => 2, 'createtime'=> time() diff --git a/application/cron/controller/RoomPan.php b/application/cron/controller/RoomPan.php index 36708b5..64f2023 100644 --- a/application/cron/controller/RoomPan.php +++ b/application/cron/controller/RoomPan.php @@ -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; diff --git a/application/cron/controller/Test.php b/application/cron/controller/Test.php index 53c5b61..661772b 100644 --- a/application/cron/controller/Test.php +++ b/application/cron/controller/Test.php @@ -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"; + } + } + } + } \ No newline at end of file