From 73c2b6863096570d468200cafe312350e651eed7 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 25 Dec 2023 16:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E9=94=80=E6=9F=A5=E8=AF=A2=E9=95=87?= =?UTF-8?q?=E5=90=88=E4=BC=99=E4=BA=BA=E5=85=AC=E5=8F=B8=E4=B8=8B=20?= =?UTF-8?q?=E9=95=87=E7=BA=A7=E4=BE=9B=E5=BA=94=E9=93=BE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Statistics.php | 39 +++++++++++++++++++++++++++++++ route/api.php | 2 ++ 2 files changed, 41 insertions(+) diff --git a/app/controller/api/Statistics.php b/app/controller/api/Statistics.php index 7f911abf..c1c89d67 100644 --- a/app/controller/api/Statistics.php +++ b/app/controller/api/Statistics.php @@ -2,6 +2,7 @@ namespace app\controller\api; +use app\common\model\system\merchant\Merchant; use app\common\model\system\merchant\MerchantType; use crmeb\basic\BaseController; use think\facade\Db; @@ -333,4 +334,42 @@ class Statistics extends BaseController return app('json')->success(compact('list')); } + + + /** + * 商户商品数量查询 + */ + public function SupplyChainProduct() + { + $parmas = $this->request->param(); + + $merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find(); + if (empty($merchant) || $merchant['type_id'] == 17) { + return app('json')->success(); + } + $merchantName = $merchant['mer_name']; + $where[] = ['mer_id', '=', $merchant['mer_id']]; + $where[] = ['mer_status', '=', 1]; + $where[] = ['status', '=', 1]; + $where[] = ['is_used', '=', 1]; + $where[] = ['is_show', '=', 1]; + $count = Db::name('store_product')->where($where)->count(); + return app('json')->success(compact('count', 'merchantName')); + } + + /** + * 商户商品库存更新查询 + */ + public function SupplyChainProductStockCount1() + { + $parmas = $this->request->param(); + + $merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find(); + if (empty($merchant) || $merchant['type_id'] == 17) { + return app('json')->success(); + } + $where[] = ['mer_id', '=', $merchant['mer_id']]; + $count = Db::name('store_product_stock')->where($where)->count(); + return app('json')->success(['count' => $count]); + } } diff --git a/route/api.php b/route/api.php index 7296ca0b..42a8c8f6 100644 --- a/route/api.php +++ b/route/api.php @@ -738,6 +738,8 @@ Route::group('api/', function () { Route::get('supply_chain_village_breeding_price_count', '/SupplyChainVillageBreedingPriceCount'); Route::get('store_order_user_trade_amount', '/StoreOrderUserTradeAmount'); Route::get('supply_chain_merchant', '/SupplyChainMerchant'); + Route::get('supply_chain_product', '/SupplyChainProduct'); + Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1'); })->prefix('api.Statistics'); //滑块验证码