查镇级普通商户商品数
This commit is contained in:
parent
cba457a123
commit
f65c8045b1
@ -63,8 +63,9 @@ class Statistics extends BaseController
|
|||||||
if (!isset($parmas['mer_intention_id']) || $parmas['mer_intention_id'] == '') {
|
if (!isset($parmas['mer_intention_id']) || $parmas['mer_intention_id'] == '') {
|
||||||
return app('json')->fail('mer_intention_id:格式错误');
|
return app('json')->fail('mer_intention_id:格式错误');
|
||||||
}
|
}
|
||||||
|
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
||||||
$where[] = ['create_time', 'between time', [date("Y-m-d H:i:s", $parmas['start_time']), date("Y-m-d H:i:s", $parmas['end_time'])]];
|
$where[] = ['create_time', 'between time', [date("Y-m-d H:i:s", $parmas['start_time']), date("Y-m-d H:i:s", $parmas['end_time'])]];
|
||||||
$where[] = ['mer_id', '=', $parmas['mer_intention_id']];
|
$where[] = ['mer_id', '=', $merchant['mer_id']];
|
||||||
$where[] = ['mer_status', '=', 1];
|
$where[] = ['mer_status', '=', 1];
|
||||||
$where[] = ['status', '=', 1];
|
$where[] = ['status', '=', 1];
|
||||||
$where[] = ['is_used', '=', 1];
|
$where[] = ['is_used', '=', 1];
|
||||||
@ -350,15 +351,35 @@ class Statistics extends BaseController
|
|||||||
return app('json')->success(compact('list'));
|
return app('json')->success(compact('list'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户商品数量查询
|
* 镇级供应链商户商品数量查询
|
||||||
*/
|
*/
|
||||||
public function SupplyChainProduct()
|
public function SupplyChainProduct()
|
||||||
{
|
{
|
||||||
$parmas = $this->request->param();
|
$parmas = $this->request->param();
|
||||||
|
|
||||||
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
||||||
if (empty($merchant) || $merchant['type_id'] == 17) {
|
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 GeneralMerchantProduct()
|
||||||
|
{
|
||||||
|
$parmas = $this->request->param();
|
||||||
|
|
||||||
|
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
||||||
|
if (empty($merchant) || $merchant['type_id'] != 10) {
|
||||||
return app('json')->success();
|
return app('json')->success();
|
||||||
}
|
}
|
||||||
$merchantName = $merchant['mer_name'];
|
$merchantName = $merchant['mer_name'];
|
||||||
@ -379,7 +400,7 @@ class Statistics extends BaseController
|
|||||||
$parmas = $this->request->param();
|
$parmas = $this->request->param();
|
||||||
|
|
||||||
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
$merchant = Merchant::where('mer_intention_id', $parmas['mer_intention_id'])->find();
|
||||||
if (empty($merchant) || $merchant['type_id'] == 17) {
|
if (empty($merchant) || $merchant['type_id'] != 17) {
|
||||||
return app('json')->success();
|
return app('json')->success();
|
||||||
}
|
}
|
||||||
$where[] = ['mer_id', '=', $merchant['mer_id']];
|
$where[] = ['mer_id', '=', $merchant['mer_id']];
|
||||||
|
@ -741,6 +741,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('supply_chain_merchant', '/SupplyChainMerchant');
|
Route::get('supply_chain_merchant', '/SupplyChainMerchant');
|
||||||
Route::get('general_merchant', '/GeneralMerchant');
|
Route::get('general_merchant', '/GeneralMerchant');
|
||||||
Route::get('supply_chain_product', '/SupplyChainProduct');
|
Route::get('supply_chain_product', '/SupplyChainProduct');
|
||||||
|
Route::get('general_merchant_product', '/GeneralMerchantProduct');
|
||||||
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
||||||
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
||||||
})->prefix('api.Statistics');
|
})->prefix('api.Statistics');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user