This commit is contained in:
aozhiwei 2020-08-19 15:45:50 +08:00
parent 0eb35fb9c2
commit 4907ff7cdd
2 changed files with 4 additions and 6 deletions

View File

@ -227,8 +227,6 @@ class AdditemController{
die(); die();
return; return;
} }
error_log($addnum + $row['coin_num']);
error_log($row['diamond_num'] - $num);
echo json_encode(array( echo json_encode(array(
'errcode' => 0, 'errcode' => 0,
'errmsg' => '', 'errmsg' => '',

View File

@ -402,7 +402,7 @@ class ShopController{
)); ));
$price = $i['price'] * $num; $price = $i['price'] * $num;
if ($row_c) { 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); $this->SubCoin($price, $account_id, 1);
} else if ($i['shop_type'] == 2) { } else if ($i['shop_type'] == 2) {
@ -413,7 +413,7 @@ class ShopController{
':id' => $id ':id' => $id
)); ));
if ($row_d) { 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); $this->SubCoin($price, $account_id, 2);
} else if ($i['shop_type'] == 3) { } else if ($i['shop_type'] == 3) {
@ -425,7 +425,7 @@ class ShopController{
)); ));
$price = $i['price'] * $num; $price = $i['price'] * $num;
if ($row_c) { 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); $this->SubCoin($price, $account_id, 1);
} else if ($type == 1) { } else if ($type == 1) {
@ -436,7 +436,7 @@ class ShopController{
':id' => $id ':id' => $id
)); ));
if ($row_d) { 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); $this->SubCoin($price, $account_id, 2);
} }