diff --git a/app/admin/controller/WorkbenchController.php b/app/admin/controller/WorkbenchController.php index 744ab58a..a8b53c30 100644 --- a/app/admin/controller/WorkbenchController.php +++ b/app/admin/controller/WorkbenchController.php @@ -19,6 +19,7 @@ use app\admin\lists\store_order_cart_info\StoreOrderCartInfoGroupMonthLists; use app\admin\logic\statistic\ProductStatisticLogic; use app\admin\logic\statistic\TradeStatisticLogic; use app\admin\logic\statistic\UserStatisticLogic; +use app\admin\logic\statistic\WarehouseLogic; use app\admin\logic\WorkbenchLogic; use app\store\logic\WorkbenchLogic as LogicWorkbenchLogic; use DateInterval; @@ -269,4 +270,14 @@ class WorkbenchController extends BaseAdminController return date("Y/m/d", strtotime("-30 days", time())) . '-' . date("Y/m/d", time()); } } + + /** + * 统计仓库 + * @return array + */ + public function total_warehouse() + { + $data=WarehouseLogic::total_warehouse(); + return $this->data($data); + } } diff --git a/app/admin/logic/statistic/WarehouseLogic.php b/app/admin/logic/statistic/WarehouseLogic.php new file mode 100644 index 00000000..5de80476 --- /dev/null +++ b/app/admin/logic/statistic/WarehouseLogic.php @@ -0,0 +1,95 @@ + '总采购金额', + 'desc' => '平台采购商品总支付金额', + 'total_money' => 22, + 'value' => [], + 'type' => 1, + ]; + + + $topData[] = [ + 'title' => '已结算金额', + 'desc' => '平台支付给供应商的金额', + 'total_money' => 6565, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '未结算金额', + 'desc' => '平台未支付给供应商的金额', + 'total_money' => 6565, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '总商品库存', + 'desc' => '平台统计商品总库存、含门店仓库', + 'total_money' => 6565, + 'cash_title' => 12322, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '总仓库库存', + 'desc' => '平台统计仓库库存', + 'total_money' => 6565, + 'cash_title' => 12322, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '海吉星仓库库存', + 'desc' => '平台统计海吉星仓库库存', + 'total_money' => 6565, + 'cash_title' => 12322, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '泸县集采集配库存', + 'desc' => '平台统计泸县集采集配库存', + 'total_money' => 6565, + 'cash_title' => 12322, + 'value' => [], + 'type' => 1, + ]; + $topData[] = [ + 'title' => '总门店库存', + 'desc' => '平台统计门店库存', + 'total_money' => 6565, + 'cash_title' => 12322, + + 'value' => [], + 'type' => 1, + ]; + $data['series'] = []; + foreach ($topData as $k => $v) { + // $data['x'] = $Chain['out']['x']; + $data['series'][$k]['name'] = $v['title']; + $data['series'][$k]['desc'] = $v['desc']; + $data['series'][$k]['total_value'] = $v['total_money']; + $data['series'][$k]['total_money'] = $v['cash_title']??''; + + $data['series'][$k]['type'] = $v['type']; + } + return $data; + } +} \ No newline at end of file