普通商户采购/销售额
This commit is contained in:
parent
c382eb9cf2
commit
120b24ca99
@ -425,7 +425,7 @@ class Statistics extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 采购金额和销售金额
|
* 镇级供应链采购金额和销售金额
|
||||||
*/
|
*/
|
||||||
public function SupplyChainProductPrice()
|
public function SupplyChainProductPrice()
|
||||||
{
|
{
|
||||||
@ -443,7 +443,39 @@ class Statistics extends BaseController
|
|||||||
$where[] = ['p.source', '=', 0];
|
$where[] = ['p.source', '=', 0];
|
||||||
}
|
}
|
||||||
$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();
|
||||||
|
}
|
||||||
|
$mer_id = $merchant['mer_id'];
|
||||||
|
$where[] = ['p.is_refund', '=', 0];
|
||||||
|
$count = Db::name('store_order_product')->alias('p')
|
||||||
|
->where($where)
|
||||||
|
->join('store_order o', 'o.mer_id=' . $mer_id . ' and o.paid=1 and o.is_del=0')
|
||||||
|
->sum('p.total_price');
|
||||||
|
$merName = $merchant['mer_name'];
|
||||||
|
return app('json')->success(compact('merName', 'count'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一般商户采购金额和销售金额
|
||||||
|
*/
|
||||||
|
public function GeneralProductPrice()
|
||||||
|
{
|
||||||
|
$parmas = $this->request->param();
|
||||||
|
if (isset($parmas['type']) && $parmas['type'] != '') {
|
||||||
|
switch ($parmas['type']) {
|
||||||
|
case 200:
|
||||||
|
$where[] = ['p.source', '=', 200];
|
||||||
|
break;
|
||||||
|
case 300:
|
||||||
|
$where[] = ['p.source', '=', 0];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$where[] = ['p.source', '=', 0];
|
||||||
|
}
|
||||||
|
$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();
|
||||||
}
|
}
|
||||||
$mer_id = $merchant['mer_id'];
|
$mer_id = $merchant['mer_id'];
|
||||||
|
@ -745,6 +745,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
||||||
Route::get('product_stock_count1', '/ProductStockCount1');
|
Route::get('product_stock_count1', '/ProductStockCount1');
|
||||||
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
||||||
|
Route::get('general_product_price', '/GeneralProductPrice');
|
||||||
})->prefix('api.Statistics');
|
})->prefix('api.Statistics');
|
||||||
|
|
||||||
//滑块验证码
|
//滑块验证码
|
||||||
|
Loading…
x
Reference in New Issue
Block a user