查镇级供应链 采购金额
This commit is contained in:
parent
d521c0d1fd
commit
932faec26d
@ -372,4 +372,33 @@ class Statistics extends BaseController
|
|||||||
$count = Db::name('store_product_stock')->where($where)->count();
|
$count = Db::name('store_product_stock')->where($where)->count();
|
||||||
return app('json')->success(['count' => $count]);
|
return app('json')->success(['count' => $count]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采购金额和销售金额
|
||||||
|
*/
|
||||||
|
public function SupplyChainProductPrice()
|
||||||
|
{
|
||||||
|
$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];
|
||||||
|
}
|
||||||
|
|
||||||
|
$mer_id = Db::name('merchant_intention')->where('mer_intention_id', $parmas['mer_intention_id'])->value('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::where('mer_id', $mer_id)->value('mer_name');
|
||||||
|
return app('json')->success(compact('merName', 'count'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -740,6 +740,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('supply_chain_merchant', '/SupplyChainMerchant');
|
Route::get('supply_chain_merchant', '/SupplyChainMerchant');
|
||||||
Route::get('supply_chain_product', '/SupplyChainProduct');
|
Route::get('supply_chain_product', '/SupplyChainProduct');
|
||||||
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
Route::get('supply_chain_product_stock_count1', '/SupplyChainProductStockCount1');
|
||||||
|
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
||||||
})->prefix('api.Statistics');
|
})->prefix('api.Statistics');
|
||||||
|
|
||||||
//滑块验证码
|
//滑块验证码
|
||||||
|
Loading…
x
Reference in New Issue
Block a user