shish 1 月之前
父節點
當前提交
a381b1e399
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      app-ghs/controllers/ConsoleController.php

+ 6 - 3
app-ghs/controllers/ConsoleController.php

@@ -46,12 +46,15 @@ class ConsoleController extends BaseController
         }
         $totalItemNum = floor($totalItemNum);
         $totalBalance = CustomClass::sum(['ownMainId'=>$this->mainId],'balance');
-        $totalBalance = abs($totalBalance);
+        $balance = 0;
+        if($totalDebt>abs($totalBalance)) {
+            $balance = bcsub($totalDebt, $totalBalance, 2);
+        }
         $overview = [
             ['name' => "库存数", "url" => '/admin/stat/stock', 'value' => $totalItemNum, 'type' => 1],
             ['name' => "库存值", "url" => '/admin/stat/stock', 'value' => $totalCost, 'type' => 1],
-            ['name' => "实际应收", "url" => '/admin/shop/debtChange', 'value' => $totalDebt, 'type' => 1],
-            ['name' => "应收款", "url" => '/admin/home/member', 'value' => $totalBalance, 'type' => 4],
+            ['name' => "应收", "url" => '/admin/shop/debtChange', 'value' => $totalDebt, 'type' => 1],
+            ['name' => "客户存款", "url" => '/admin/home/member', 'value' => $balance, 'type' => 4],
             ['name' => "总访客", "url" => '/admin/home/member', 'value' => 0, 'type' => 4],
             ['name' => "总订单", "url" => '/admin/home/order', 'value' => 0, 'type' => 4],
         ];