add 新供销用户邀请信息统计
This commit is contained in:
parent
657a990003
commit
5eb6e64cd2
@ -487,4 +487,26 @@ class Statistics extends BaseController
|
||||
$merName = $merchant['mer_name'];
|
||||
return app('json')->success(compact('merName', 'count'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新供销 查询邀请的 用户注册数 商户数 交易金额
|
||||
*/
|
||||
public function InviteUserStatistics()
|
||||
{
|
||||
$parmas = $this->request->param();
|
||||
$promotionCode = $parmas['promotion_code'];
|
||||
$datas = [];
|
||||
// 用户注册数
|
||||
$datas['user_count'] = Db::name('user')->where('promotion_code', $promotionCode)->count();
|
||||
|
||||
$userIds = Db::name('user')->where('promotion_code', $promotionCode)->value('uid');
|
||||
|
||||
// 商户数
|
||||
$datas['merchant_count'] = Merchant::whereIn('uid', $userIds)->count();
|
||||
|
||||
// 交易金额
|
||||
$datas['trade_amount'] = Db::name('store_order')->whereIn('uid', $userIds)->where('paid', 1)->sum('pay_price');
|
||||
|
||||
return app('json')->success($datas);
|
||||
}
|
||||
}
|
||||
|
@ -750,6 +750,7 @@ Route::group('api/', function () {
|
||||
Route::get('product_stock_count1', '/ProductStockCount1');
|
||||
Route::get('supply_chain_product_price', '/SupplyChainProductPrice');
|
||||
Route::get('general_product_price', '/GeneralProductPrice');
|
||||
Route::get('invite_user_statistics', '/InviteUserStatistics');
|
||||
})->prefix('api.Statistics');
|
||||
|
||||
//滑块验证码
|
||||
|
Loading…
x
Reference in New Issue
Block a user