供销查询镇合伙人公司下 镇级供应链列表

This commit is contained in:
chenbo 2023-12-25 11:23:45 +08:00
parent 9398dfc214
commit 9dee1d2174
2 changed files with 23 additions and 0 deletions

View File

@ -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'));
}
}

View File

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