|
|
@@ -2,8 +2,6 @@
|
|
|
|
|
|
namespace ghs\controllers;
|
|
|
|
|
|
-use biz\stat\services\StatOutService;
|
|
|
-use bizGhs\clear\classes\ClearClass;
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
use bizGhs\stat\classes\StatKdClass;
|
|
|
@@ -21,9 +19,12 @@ class ConsoleController extends BaseController
|
|
|
//总览
|
|
|
public function actionStat()
|
|
|
{
|
|
|
- $where = ['shopId' => $this->shopId, 'debt' => 1]; // 重新赋值
|
|
|
- $totalDebt = OrderClass::sum($where, 'remainDebtPrice'); // 总欠款
|
|
|
- $totalDebt = $totalDebt === null ? 0 : $totalDebt;
|
|
|
+ $where = ['mainId' => $this->mainId, '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,cost', null, true);
|
|
|
$totalItemNum = 0;
|