|
|
@@ -24,12 +24,12 @@ class ConsoleController extends BaseController
|
|
|
//总览
|
|
|
public function actionStat()
|
|
|
{
|
|
|
- $where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
|
|
|
- $pfDebt = OrderClass::sum($where, 'remainDebtPrice'); // 总欠款
|
|
|
- $pfDebt = $pfDebt === null ? 0 : $pfDebt;
|
|
|
- $lsDebt = \bizHd\order\classes\OrderClass::sum(['mainId' => $this->mainId, 'debt' => 1], 'remainDebtPrice');
|
|
|
- $lsDebt = $lsDebt === null ? 0 : $lsDebt;
|
|
|
- $totalDebt = bcadd($pfDebt, $lsDebt, 2);
|
|
|
+ //$where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
|
|
|
+ //$pfDebt = OrderClass::sum($where, 'remainDebtPrice'); // 总欠款
|
|
|
+ //$pfDebt = $pfDebt === null ? 0 : $pfDebt;
|
|
|
+ //$lsDebt = \bizHd\order\classes\OrderClass::sum(['mainId' => $this->mainId, 'debt' => 1], 'remainDebtPrice');
|
|
|
+ //$lsDebt = $lsDebt === null ? 0 : $lsDebt;
|
|
|
+ //$totalDebt = bcadd($pfDebt, $lsDebt, 2);
|
|
|
$itemList = ItemClass::getAllByCondition(['mainId' => $this->mainId], null, 'id,stock,avCost,cost,virtualStock,delStatus', null, true);
|
|
|
$totalItemNum = 0;
|
|
|
$totalCost = 0;
|
|
|
@@ -46,15 +46,12 @@ class ConsoleController extends BaseController
|
|
|
}
|
|
|
$totalItemNum = floor($totalItemNum);
|
|
|
$totalBalance = CustomClass::sum(['ownMainId'=>$this->mainId],'balance');
|
|
|
- $balance = 0;
|
|
|
- if($totalDebt>abs($totalBalance)) {
|
|
|
- $balance = bcsub($totalDebt, abs($totalBalance), 2);
|
|
|
- }
|
|
|
+ $may = $totalBalance<0 ? abs($totalBalance) : 0;
|
|
|
$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' => $balance, 'type' => 4],
|
|
|
+ ['name' => "应收款", "url" => '/admin/shop/debtChange', 'value' => $may, 'type' => 1],
|
|
|
+ ['name' => "未命名", "url" => '/admin/home/member', 'value' => 0, 'type' => 4],
|
|
|
['name' => "总访客", "url" => '/admin/home/member', 'value' => 0, 'type' => 4],
|
|
|
['name' => "总订单", "url" => '/admin/home/order', 'value' => 0, 'type' => 4],
|
|
|
];
|