From fa133911b8429b07c188d508dc2599a597879adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Fri, 12 Dec 2025 11:38:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8A=9F=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4-=E6=AF=8F=E6=97=A5=E7=AD=BE=E5=88=B0=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91-=E7=AD=BE=E5=88=B0=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Decorate.php | 2 +- application/api/model/Tasks.php | 30 +++++++++++++++++++++++-- application/api/model/UserGiftPack.php | 5 ++++- application/common/model/UserWallet.php | 6 ++++- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/application/api/model/Decorate.php b/application/api/model/Decorate.php index ea20fbd3..c982e804 100644 --- a/application/api/model/Decorate.php +++ b/application/api/model/Decorate.php @@ -17,7 +17,7 @@ class Decorate extends Model protected $updateTime = 'updatetime'; // 定义字段类型 1头像框 2坐骑 3麦圈 6个人靓号 7房间靓号 8公会靓号 public $TypeArray = [1=>'头像框',12=>'降身卡',2=>'坐骑',9=>'聊天气泡',6=>'个人靓号',7=>'房间靓号',8=>'公会靓号',3=>'麦圈',10=>'CP特效',11=>'CP装扮']; - protected $FromType = [1=>'购买',2=>'后台赠送',3=>'礼盒开奖',4=>'好友赠送',5=>'首充赠送',6=>'天降好礼获得',7=>'财富等级特权赠送',8=>'新人充值好礼',9=>'爵位购买赠送',10=>'任务奖励']; + protected $FromType = [1=>'购买',2=>'后台赠送',3=>'礼盒开奖',4=>'好友赠送',5=>'首充赠送',6=>'天降好礼获得',7=>'财富等级特权赠送',8=>'新人充值好礼',9=>'爵位购买赠送',10=>'任务奖励',11=>"每日签到"]; public function __construct($data = []) { parent::__construct($data); diff --git a/application/api/model/Tasks.php b/application/api/model/Tasks.php index 34593bf8..08d897c5 100644 --- a/application/api/model/Tasks.php +++ b/application/api/model/Tasks.php @@ -443,7 +443,7 @@ class Tasks extends Model $res = model('common/UserWallet')->change_user_money($user_id, $v['quantity'], model('common/UserWallet')::MONEYTYPECOIN, model('common/UserWallet')::DAILY_TASKS_REWARD,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::DAILY_TASKS_REWARD)); break; case 2: //礼物 方法2:添加到用户礼物背包 - $res = model('UserGiftPack')->change_user_gift_pack($user_id,$v['foreign_id'],$v['quantity'],model('UserGiftPack')::TASK_REWARD,"天降好礼获得礼物"); + $res = model('UserGiftPack')->change_user_gift_pack($user_id,$v['foreign_id'],$v['quantity'],model('UserGiftPack')::TASK_REWARD,"完成任务获得礼物"); break; case 3: //坐骑 方法3:添加到用户装扮 $decorate_price_info = db::name('vs_decorate_price')->where(['id'=>$v['foreign_id']])->find(); @@ -614,6 +614,32 @@ class Tasks extends Model 'updatetime' => time() ]); if ($reslut) { + //发放签到礼物 + $detail_list = DB::name('vs_gift_bag_detail')->where(['gift_bag_id'=>18])->limit(7)->order('id asc')->select(); + foreach ($detail_list as $k=>$v){ + $day = $k+1; + if($continuous == $day){ + switch ($v['type']) { + case 1: //金币 方法1:直接添加到用户钱包 + $res = model('common/UserWallet')->change_user_money($user_id, $v['quantity'], model('common/UserWallet')::MONEYTYPECOIN, model('common/UserWallet')::DAILY_SIGN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::DAILY_SIGN)); + break; + case 2: //礼物 方法2:添加到用户礼物背包 + $res = model('UserGiftPack')->change_user_gift_pack($user_id,$v['foreign_id'],$v['quantity'],model('UserGiftPack')::DAILY_SIGN,"每日签到获得礼物"); + break; + case 3: //坐骑 方法3:添加到用户装扮 + $decorate_price_info = db::name('vs_decorate_price')->where(['id'=>$v['foreign_id']])->find(); + if(empty($decorate_price_info)){ + break; + } + $res = model('Decorate')->pay_decorate($user_id,$decorate_price_info['did'],$decorate_price_info['day'],11); + break; + case 4: //道具 方法5:钻石 + $res = model('common/UserWallet')->change_user_money($user_id, $v['quantity'], model('common/UserWallet')::MONEYTYPEARNINGS, model('common/UserWallet')::DAILY_SIGN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::DAILY_SIGN)); + default: + break; + } + } + } // 提交事务 Db::commit(); return ['code' => 1, 'msg' => '操作成功','data' => null]; @@ -632,7 +658,7 @@ class Tasks extends Model */ public function daily_tasks_sign_in_status($user_id){ //礼包 - $detail_list = DB::name('vs_gift_bag_detail')->where(['gift_bag_id'=>18])->limit(7)->select(); + $detail_list = DB::name('vs_gift_bag_detail')->where(['gift_bag_id'=>18])->limit(7)->order('id asc')->select(); $list= []; foreach ($detail_list as $k=>$v){ $day = $k+1; diff --git a/application/api/model/UserGiftPack.php b/application/api/model/UserGiftPack.php index e1e30e9c..4de60800 100644 --- a/application/api/model/UserGiftPack.php +++ b/application/api/model/UserGiftPack.php @@ -40,6 +40,8 @@ class UserGiftPack extends Model const NEW_CHARGE_GIFT = 10; //任务奖励 const TASK_REWARD = 11; + //每日签到 + const DAILY_SIGN = 12; public static function init() { @@ -60,7 +62,8 @@ class UserGiftPack extends Model self::XLH_DRAW_GIFT_GET => '巡乐会抽奖所得', self::HOUR_RANK_GET => '小时榜获得', self::NEW_CHARGE_GIFT => '新人充值好礼', - self::TASK_REWARD => '任务奖励' + self::TASK_REWARD => '任务奖励', + self::DAILY_SIGN => '每日签到' ]; } diff --git a/application/common/model/UserWallet.php b/application/common/model/UserWallet.php index da24df49..6d49f043 100644 --- a/application/common/model/UserWallet.php +++ b/application/common/model/UserWallet.php @@ -106,6 +106,9 @@ class UserWallet extends Model const SIGN_BE_SIGNED_INCOME = 55; //续约 const RENEWAL = 56; + //每日签到 + const DAILY_SIGN = 57; + //金币支出类型数组 @@ -188,7 +191,8 @@ class UserWallet extends Model self::SIGN_MASTER_DAILY_RETURN => '签约师傅每日返还', self::BELIEVER_COMPENSATION => '解约补偿', self::SIGN_BE_SIGNED_INCOME => '被签约者收礼返佣给上级', - self::RENEWAL => '续约' + self::RENEWAL => '续约', + self::DAILY_SIGN => '每日签到' ]; if($type){