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'); //滑块验证码