From 69da19f1456f8921e02440fed24985a401ff85f8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 23 Sep 2020 19:05:24 +0800 Subject: [PATCH] 1 --- webapp/controller/RoleController.class.php | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 0509a1a..ce47d77 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -224,6 +224,9 @@ class RoleController{ $share_equip_times = 0; $daily_diamond_times = 0; } + + //更新新手礼 + $newhand = $this->getnewhandinfo($row['newhand'], $row['game_times2'], $row['view_times2'], $account_id); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', @@ -259,13 +262,35 @@ class RoleController{ 'box_num' => $box_num, 'share_equip_times' => $share_equip_times, 'daily_diamond_times' => $daily_diamond_times, - 'newhand' => $row['newhand'], + 'newhand' => $newhand, 'game_times2' => $row['game_times2'], 'view_times2' => $row['view_times2'], )); } } + protected function getnewhandinfo($status, $num1, $num2, $account_id) + { + $p3 = $this->getParameter(ZIJIE_ACTIVITY_FIGHT); + $fight_times2 = $p3['param_value']; + $p4 = $this->getParameter(ZIJIE_ACTIVITY_ADS); + $view_times2 = $p4['param_value']; + $conn = $this->getMysql($account_id); + if ($num1 >= $fight_times2 && $num2 >= $view_times2 && $status == 0) { + $ret = $conn->execScript('UPDATE user SET newhand=1, ' . + 'modify_time=:modify_time WHERE accountid=:accountid;', + array( + ':accountid' => $account_id, + ':modify_time' => time(), + )); + if (!$ret) { + die(); + } + return 1; + } + return $status; + } + protected function updateDaily($account_id, $daily_time) { $nowTime = phpcommon\getdayseconds(time());