|
@@ -15,23 +15,16 @@ class OrderService
|
|
|
$todayTimeUnix = strtotime(date('Y-m-d'));
|
|
|
|
|
|
$data['todayOrder'] = Order::where('order_addtimes', '>', $todayTimeUnix)->where('order_category', '<>', 'RECHARGE')->count();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
$data['todayRevenue'] = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ', [$todayTimeUnix])
|
|
|
+ ->whereIn('pay_category',['GOODS','SERVICE','CHNMED','CHNNCD','PACKAGE','MEALS'])
|
|
|
->where('join_pay_order_id', '<>', '')
|
|
|
->where('pay_status', 'SUCCESS')
|
|
|
- ->where('pay_category', '<>', 'RETURN')
|
|
|
- ->where('pay_category', '<>', 'REFUND')
|
|
|
- ->where('pay_category', '<>', 'ROLE_REFUND')
|
|
|
- ->where('pay_category', '<>', 'RECHARGE')
|
|
|
- ->where('pay_category', '<>', 'CLEAR')
|
|
|
->sum('pay_amount');
|
|
|
$refundAmount = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ', [$todayTimeUnix])
|
|
|
->where('pay_status', 'SUCCESS')
|
|
|
->whereIn('pay_category', ['REFUND', 'ROLE_REFUND'])
|
|
|
->sum('pay_amount');
|
|
|
-
|
|
|
$data['todayRevenue'] = round($data['todayRevenue'], 2);
|
|
|
|
|
|
$data['todayRecharge'] = Order::where('order_status_payment', 'SUCCESS')
|
|
@@ -42,6 +35,14 @@ class OrderService
|
|
|
|
|
|
$data['todayRefund'] = $refundAmount;
|
|
|
|
|
|
+
|
|
|
+ $data['todaySales'] = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ', [$todayTimeUnix])
|
|
|
+ ->whereIn('pay_prepayid',['WXPAY','ALIPAY','OFFLINE_WXPAY','OFFLINE_ALIPAY','MONEY'])
|
|
|
+ ->where('join_pay_order_id', '<>', '')
|
|
|
+ ->where('pay_status', 'SUCCESS')
|
|
|
+ ->sum('pay_amount');
|
|
|
+
|
|
|
+ $data['todaySales'] = round($data['todaySales'], 2);
|
|
|
|
|
|
|
|
|
|