From 9dee1d2174e5c9367b3c5e74dbb02197041afabc Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Mon, 25 Dec 2023 11:23:45 +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 | 22 ++++++++++++++++++++++ route/api.php | 1 + 2 files changed, 23 insertions(+) diff --git a/app/controller/api/Statistics.php b/app/controller/api/Statistics.php index b4dcca17..7f911abf 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\MerchantType; use crmeb\basic\BaseController; use think\facade\Db; @@ -40,6 +41,9 @@ class Statistics extends BaseController } $where[] = ['is_del', '=', 0]; $where[] = ['status', '=', 1]; + // 镇级供应链 type_code = TypeTownSupplyChain + $merchantType = MerchantType::where('type_code', 'TypeTownSupplyChain')->find(); + $where[] = ['type_id', '=', $merchantType['mer_type_id']]; $count = Db::name('merchant')->where($where)->count(); return app('json')->success(['count' => $count]); } @@ -311,4 +315,22 @@ class Statistics extends BaseController ->sum('p.total_price'); return app('json')->success(['trade_amount' => $count]); } + + // 镇级下的镇级供应链商户 + public function SupplyChainMerchant() + { + $parmas = $this->request->param(); + + $where[] = ['street_id', '=', $parmas['street_code']]; + $where[] = ['is_del', '=', 0]; + $where[] = ['status', '=', 1]; + // 镇级供应链 type_code = TypeTownSupplyChain + $merchantType = MerchantType::where('type_code', 'TypeTownSupplyChain')->find()->toArray(); + + $where[] = ['type_id', '=', $merchantType['mer_type_id']]; + + $list = Db::name('merchant')->where($where)->select(); + + return app('json')->success(compact('list')); + } } diff --git a/route/api.php b/route/api.php index 3606e8f7..ba87473d 100644 --- a/route/api.php +++ b/route/api.php @@ -734,6 +734,7 @@ Route::group('api/', function () { Route::get('supply_chain_breeding_street_product_count', '/SupplyChainBreedingStreetProductCount'); Route::get('supply_chain_village_breeding_price_count', '/SupplyChainVillageBreedingPriceCount'); Route::get('store_order_user_trade_amount', '/StoreOrderUserTradeAmount'); + Route::get('supply_chain_merchant', '/SupplyChainMerchant'); })->prefix('api.Statistics'); //滑块验证码