From ac90da3c39cc78132a857b4a24f36f1bb2fe6d48 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 31 Aug 2020 18:39:27 +0800 Subject: [PATCH] 1 --- webapp/controller/EquipController.class.php | 6 ++---- webapp/controller/ShopController.class.php | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/controller/EquipController.class.php b/webapp/controller/EquipController.class.php index 3a863b0..11e2892 100644 --- a/webapp/controller/EquipController.class.php +++ b/webapp/controller/EquipController.class.php @@ -597,14 +597,12 @@ class EquipController{ } } $active_time = $row['active_time']; - if ($active_time + $sub_time <= time()) { + if ($active_time + $sub_time <= time() || + $active_time + $row['sub_time'] <= time() + 30) { $active_time = 0; $sub_time = 0; $flag = 1; } - // if ($sub_time == 0) { - // $flag = 1; - // } $retEquip = $conn->execScript('UPDATE equip SET active_time=:active_time, sub_time=:sub_time, modify_time=:modify_time ' . ' WHERE accountid=:accountid AND id=:id;', array( diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 2949e01..3d67941 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -227,6 +227,7 @@ class ShopController{ $active_time = $user_db['active_time']; $nowTime = phpcommon\getdayseconds(time()); $passed_days = floor(($nowTime - phpcommon\getdayseconds($user_db['active_time'])) / (3600 * 24)); + //$passed_days = 2; if ($passed_days >= 1) { for ($i = 1; $i <= count($shop_conf); $i++) { if ($shop_conf[$i]['isrefresh'] == 0) { @@ -359,7 +360,8 @@ class ShopController{ 'coin_nums' => $coin_num, 'diamond_nums' => $diamond_num, 'item_list' => $item_list, - 'all_item_list' => $all_item_list + 'all_item_list' => $all_item_list, + 'id' => $id, )); }