|
@@ -15,23 +15,16 @@ class OrderService
|
|
|
$todayTimeUnix = strtotime(date('Y-m-d'));
|
|
|
// 今日订单
|
|
|
$data['todayOrder'] = Order::where('order_addtimes', '>', $todayTimeUnix)->where('order_category', '<>', 'RECHARGE')->count();
|
|
|
- // 今日收入
|
|
|
-// $couponDetails = Db::select("select * from app_coupon_detail where coupon_detail_deadline_datetime != '' AND CAST(UNIX_TIMESTAMP(coupon_detail_deadline_datetime) as SIGNED) < " . time());
|
|
|
-
|
|
|
+ // 今日营业额
|
|
|
$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'] = $data['todayRevenue'] - $refundAmount;
|
|
|
$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);
|
|
|
|
|
|
// 柱状图
|
|
|
// 产品订单
|