From 8273a15e8792559f3efb89f5abcfb2a680eb567e Mon Sep 17 00:00:00 2001 From: hujiabin Date: Fri, 16 Sep 2022 21:29:59 +0800 Subject: [PATCH] 1 --- webapp/controller/ChipController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/controller/ChipController.class.php b/webapp/controller/ChipController.class.php index d2dca3ad..b996bf1e 100644 --- a/webapp/controller/ChipController.class.php +++ b/webapp/controller/ChipController.class.php @@ -497,13 +497,13 @@ class ChipController extends BaseAuthedController } $chip_param = $data; } - $cumulative_cost = 0; + $cumulative_cost = []; $token_id_arr = []; foreach ($chip_param as $value){ - $cumulative_cost += $value['cost']; + array_push($cumulative_cost,$value['cost']); array_push($token_id_arr,$value['token_id']); } - $this->_rspData(['data'=>['cost'=>$cumulative_cost,'token_ids'=>implode(' ',$token_id_arr)]]); + $this->_rspData(['data'=>['cost'=>$cumulative_cost,'token_ids'=>$token_id_arr]]); } public function lockChip(){