shish 4 rokov pred
rodič
commit
5f644e6b3e
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      app-ghs/controllers/ExpendController.php

+ 4 - 2
app-ghs/controllers/ExpendController.php

@@ -42,10 +42,11 @@ class ExpendController extends BaseController
                 if (empty($main)) {
                 if (empty($main)) {
                     util::fail('没有门店信息');
                     util::fail('没有门店信息');
                 }
                 }
-                $main->money = bcsub($main->money, $amount, 2);
-                if ($main->money < 0) {
+                $balance = bcsub($main->money, $amount, 2);
+                if ($balance < 0) {
                     util::fail('现金不足');
                     util::fail('现金不足');
                 }
                 }
+                $main->money = $balance;
                 $main->save();
                 $main->save();
 
 
                 $staffId = $this->shopAdminId;
                 $staffId = $this->shopAdminId;
@@ -57,6 +58,7 @@ class ExpendController extends BaseController
                 $capitalType = dict::getDict('capitalType', 'expendRegister', 'id');
                 $capitalType = dict::getDict('capitalType', 'expendRegister', 'id');
 
 
                 $data = [];
                 $data = [];
+                $data['balance'] = $balance;
                 $data['mainId'] = $mainId;
                 $data['mainId'] = $mainId;
                 $data['sjId'] = $this->sjId;
                 $data['sjId'] = $this->sjId;
                 $data['amount'] = $amount;
                 $data['amount'] = $amount;