瀏覽代碼

现金变动

shish 4 年之前
父節點
當前提交
5f644e6b3e
共有 1 個文件被更改,包括 4 次插入2 次删除
  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)) {
                     util::fail('没有门店信息');
                 }
-                $main->money = bcsub($main->money, $amount, 2);
-                if ($main->money < 0) {
+                $balance = bcsub($main->money, $amount, 2);
+                if ($balance < 0) {
                     util::fail('现金不足');
                 }
+                $main->money = $balance;
                 $main->save();
 
                 $staffId = $this->shopAdminId;
@@ -57,6 +58,7 @@ class ExpendController extends BaseController
                 $capitalType = dict::getDict('capitalType', 'expendRegister', 'id');
 
                 $data = [];
+                $data['balance'] = $balance;
                 $data['mainId'] = $mainId;
                 $data['sjId'] = $this->sjId;
                 $data['amount'] = $amount;