From 4907ff7cdd3ffe301b58536f737aad6b80faae1e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 19 Aug 2020 15:45:50 +0800 Subject: [PATCH] 1 --- webapp/controller/AdditemController.class.php | 2 -- webapp/controller/ShopController.class.php | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/webapp/controller/AdditemController.class.php b/webapp/controller/AdditemController.class.php index b1f6d8f..9cc2fa4 100644 --- a/webapp/controller/AdditemController.class.php +++ b/webapp/controller/AdditemController.class.php @@ -227,8 +227,6 @@ class AdditemController{ die(); return; } - error_log($addnum + $row['coin_num']); - error_log($row['diamond_num'] - $num); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index c35566d..241c355 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -402,7 +402,7 @@ class ShopController{ )); $price = $i['price'] * $num; if ($row_c) { - $price = round($i['price'] * $row_c['coin_discount'] / 10); + $price = round($i['price'] * $num * $row_c['coin_discount'] / 10); } $this->SubCoin($price, $account_id, 1); } else if ($i['shop_type'] == 2) { @@ -413,7 +413,7 @@ class ShopController{ ':id' => $id )); if ($row_d) { - $price = round($i['dprice'] * $row_d['diamond_discount'] / 10); + $price = round($i['dprice'] * $num * $row_d['diamond_discount'] / 10); } $this->SubCoin($price, $account_id, 2); } else if ($i['shop_type'] == 3) { @@ -425,7 +425,7 @@ class ShopController{ )); $price = $i['price'] * $num; if ($row_c) { - $price = round($price * $row_c['coin_discount'] / 10); + $price = round($i['price'] * $num * $row_c['coin_discount'] / 10); } $this->SubCoin($price, $account_id, 1); } else if ($type == 1) { @@ -436,7 +436,7 @@ class ShopController{ ':id' => $id )); if ($row_d) { - $price = round($dprice * $row_d['diamond_discount'] / 10); + $price = round($i['dprice'] * $num * $row_d['diamond_discount'] / 10); } $this->SubCoin($price, $account_id, 2); }