feat(WorkbenchLogic): 修改了访客数和付款转化率的计算方式
This commit is contained in:
parent
304f6ba303
commit
30744407c7
@ -72,15 +72,17 @@ class WorkbenchLogic extends BaseLogic
|
||||
public static function get_basic($where)
|
||||
{
|
||||
$browse = StoreVisit::where($where)->count();
|
||||
$user = 0;
|
||||
$user = StoreVisit::where($where)->group('uid')->count();
|
||||
$cart = Cart::where($where)->where('is_fail', 0)->sum('cart_num');
|
||||
$order = StoreOrder::where($where)->count();
|
||||
$payPeople = StoreOrder::where($where)->group('uid')->count();
|
||||
$pay = StoreOrder::where($where)->where('paid', 1)->where('refund_status', 0)->count();
|
||||
$payPrice = StoreOrder::where($where)->where('paid', 1)->where('refund_status', 0)->sum('pay_price');
|
||||
$cost = StoreOrder::where($where)->where('paid', 1)->sum('cost');
|
||||
$refundPrice = StoreOrder::where($where)->where('status', 'in', [-1, -2])->sum('refund_price');
|
||||
$refund = StoreOrder::where($where)->where('status', 'in', [-1, -2])->count();
|
||||
$payPercent = 0;
|
||||
$payPercent = bcmul((string)($user > 0 ? bcdiv($payPeople, $user, 4) : 0), '100', 2); //访客-付款转化率
|
||||
|
||||
return [
|
||||
'browse' => ['num' => $browse, 'title' => '浏览量'], //浏览量
|
||||
'user' => ['num' => $user, 'title' => '访客数'], //访客数
|
||||
|
Loading…
x
Reference in New Issue
Block a user