From 7d2c35c4c787ad3a1cdd5158ba3a33181edf37a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Thu, 25 Dec 2025 12:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=88=E5=BE=92=E4=BB=BB=E5=8A=A1bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9-=E4=BB=BB=E5=8A=A124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Tasks.php | 34 +++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/application/api/model/Tasks.php b/application/api/model/Tasks.php index 73420ad3..b4ad71eb 100644 --- a/application/api/model/Tasks.php +++ b/application/api/model/Tasks.php @@ -200,16 +200,23 @@ class Tasks extends Model if(empty($user_sign_task)){ continue; } + $user_sign_task_count = Db::name('vs_user_sign_task')->where(['user_id'=>$user_id])->count(); $v['gold_reward'] = $user_sign_task['value']; - $v['target_quantity'] = $v['target_quantity'] * 60; + $v['target_quantity'] = $v['target_quantity'] * $user_sign_task_count; $v['is_time'] = 1; if($user_sign_task['status']==1){ $progress = $user_sign_task['times'] ?? 0; }else{ $progress = $user_sign_task['times']-1 ?? 0; } - } - if(in_array($v['task_id'],[26,27,28,29,30,31,32])){ + if($user_sign_task_count['status']==1){ + $v['task_status'] = 3; + $v['task_type_str'] = "已领取"; + }else{ + $v['task_status'] = 2; + $v['task_type_str'] = "领取奖励"; + } + }elseif(in_array($v['task_id'],[26,27,28,29,30,31,32])){ $user_couple_times =[26=>1,27=>2,28=>3,29=>4,30=>5,31=>6,32=>7]; //情侣任务 $user_couple_task = Db::name('vs_user_cp_task')->where(['user_id'=>$user_id,'times'=>$user_couple_times[$v['task_id']],'delete_time'=>0])->find(); @@ -523,11 +530,22 @@ class Tasks extends Model return ['code' => 0, 'msg' => '操作失败', 'data' => null]; } } - //发放任务礼包 - $op_bag_re = $this->open_tasks_bag($user_id,$task_info['tasks_bag_id']); - if ($op_bag_re['code'] != 1) { - Db::rollback(); - return ['code' => 0, 'msg' => $op_bag_re['msg'], 'data' => null]; + //24不发礼包 + if($task_id!=24){ + //发放任务礼包 + $op_bag_re = $this->open_tasks_bag($user_id,$task_info['tasks_bag_id']); + if ($op_bag_re['code'] != 1) { + Db::rollback(); + return ['code' => 0, 'msg' => $op_bag_re['msg'], 'data' => null]; + } + }else{ + //24发钻石 + //发放钻石 + $res = model('common/UserWallet')->change_user_money($user_id, $user_sign_task['value'], model('common/UserWallet')::MONEYTYPEARNINGS, model('common/UserWallet')::SIGN_MASTER_DAILY_RETURN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::SIGN_MASTER_DAILY_RETURN)." 第".$user_sign_task['times']."天"); + if ($res['code'] != 1) { + Db::rollback(); + return ['code' => 0, 'msg' => $res['msg'], 'data' => null]; + } } // 提交事务 Db::commit();