shish 2 vuotta sitten
vanhempi
commit
ab927899e9
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      app-ghs/controllers/ExpendController.php

+ 3 - 3
app-ghs/controllers/ExpendController.php

@@ -44,9 +44,9 @@ class ExpendController extends BaseController
     public function actionBx()
     {
         $get = Yii::$app->request->get();
-        $amount = $get['amount'] ?? 0;
+        $postAmount = $get['amount'] ?? 0;
         $staffId = $get['staffId'] ?? 0;
-        if ($amount <= 0) {
+        if ($postAmount <= 0) {
             util::fail('没有需要报销的金额');
         }
         $connection = Yii::$app->db;//事务处理
@@ -71,7 +71,7 @@ class ExpendController extends BaseController
             }
             $bx->amount = $total;
             $bx->save();
-            if (floatval($amount) != floatval($total)) {
+            if (floatval($postAmount) != floatval($total)) {
                 util::fail('金额有问题,返回上页再进来');
             }
             $transaction->commit();