|
@@ -18,25 +18,26 @@ class OrderService
|
|
|
// 今日收入
|
|
|
// $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])
|
|
|
- ->where('join_pay_order_id','<>','')
|
|
|
+ $data['todayRevenue'] = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ', [$todayTimeUnix])
|
|
|
+ ->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])
|
|
|
+ $refundAmount = PayDetail::whereRaw('CAST(UNIX_TIMESTAMP(pay_paytimes) as SIGNED) > ? ', [$todayTimeUnix])
|
|
|
->where('pay_status', 'SUCCESS')
|
|
|
- ->where('pay_category', 'REFUND')
|
|
|
+ ->whereIn('pay_category', ['REFUND', 'ROLE_REFUND'])
|
|
|
->sum('pay_amount');
|
|
|
// $data['todayRevenue'] = $data['todayRevenue'] - $refundAmount;
|
|
|
- $data['todayRevenue'] = round($data['todayRevenue'],2);
|
|
|
+ $data['todayRevenue'] = round($data['todayRevenue'], 2);
|
|
|
// 今日充值额
|
|
|
$data['todayRecharge'] = Order::where('order_status_payment', 'SUCCESS')
|
|
|
->where('order_addtimes', '>', $todayTimeUnix)
|
|
|
->where('order_category', 'RECHARGE')
|
|
|
- ->where('order_status_payment','SUCCESS')
|
|
|
+ ->where('order_status_payment', 'SUCCESS')
|
|
|
->sum('order_amount_pay');
|
|
|
// 今日退单
|
|
|
$data['todayRefund'] = $refundAmount;
|
|
@@ -79,29 +80,29 @@ class OrderService
|
|
|
|
|
|
sort($category);
|
|
|
|
|
|
- foreach ($category as $item2){
|
|
|
+ foreach ($category as $item2) {
|
|
|
$isHaveService = false;
|
|
|
$isHaveGoods = false;
|
|
|
- foreach ($newAdditionService as $item){
|
|
|
- if ($item2 == $item->month){
|
|
|
+ foreach ($newAdditionService as $item) {
|
|
|
+ if ($item2 == $item->month) {
|
|
|
$isHaveService = true;
|
|
|
$newAdditionServiceData['category'][] = $item->month;
|
|
|
$newAdditionServiceData['data'][] = $item->num;
|
|
|
}
|
|
|
}
|
|
|
- foreach ($newAddition as $item3){
|
|
|
- if ($item2 == $item3->month){
|
|
|
+ foreach ($newAddition as $item3) {
|
|
|
+ if ($item2 == $item3->month) {
|
|
|
$isHaveGoods = true;
|
|
|
$newAdditionData['category'][] = $item3->month;
|
|
|
$newAdditionData['data'][] = $item3->num;
|
|
|
}
|
|
|
}
|
|
|
- if (!$isHaveService){
|
|
|
+ if (!$isHaveService) {
|
|
|
$newAdditionServiceData['category'][] = $item2;//['month'=>$item2,'num'=>0];
|
|
|
$newAdditionServiceData['data'][] = 0;
|
|
|
}
|
|
|
|
|
|
- if (!$isHaveGoods){
|
|
|
+ if (!$isHaveGoods) {
|
|
|
$newAdditionData['category'][] = $item2;//['month'=>$item2,'num'=>0];
|
|
|
$newAdditionData['data'][] = 0;
|
|
|
}
|