mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	fix: stat
This commit is contained in:
		| @@ -49,7 +49,7 @@ class CheckCommission extends Command | |||||||
|         if ((int)config('v2board.commission_auto_check_enable', 1)) { |         if ((int)config('v2board.commission_auto_check_enable', 1)) { | ||||||
|             Order::where('commission_status', 0) |             Order::where('commission_status', 0) | ||||||
|                 ->where('invite_user_id', '!=', NULL) |                 ->where('invite_user_id', '!=', NULL) | ||||||
|                 ->whereIn('status', [3, 4]) |                 ->whereIn('status', '!=', [0, 2]) | ||||||
|                 ->where('updated_at', '<=', strtotime('-3 day', time())) |                 ->where('updated_at', '<=', strtotime('-3 day', time())) | ||||||
|                 ->update([ |                 ->update([ | ||||||
|                     'commission_status' => 1 |                     'commission_status' => 1 | ||||||
|   | |||||||
| @@ -52,7 +52,7 @@ class V2BoardStatistics extends Command | |||||||
|         $startAt = strtotime('-1 day', $endAt); |         $startAt = strtotime('-1 day', $endAt); | ||||||
|         $builder = Order::where('created_at', '>=', $startAt) |         $builder = Order::where('created_at', '>=', $startAt) | ||||||
|             ->where('created_at', '<', $endAt) |             ->where('created_at', '<', $endAt) | ||||||
|             ->whereIn('status', [3, 4]); |             ->whereIn('status', '!=', [0, 2]); | ||||||
|         $orderCount = $builder->count(); |         $orderCount = $builder->count(); | ||||||
|         $orderAmount = $builder->sum('total_amount'); |         $orderAmount = $builder->sum('total_amount'); | ||||||
|         $builder = $builder->where('commission_balance', '!=', 0) |         $builder = $builder->where('commission_balance', '!=', 0) | ||||||
|   | |||||||
| @@ -25,7 +25,7 @@ class OrderController extends Controller | |||||||
|         } |         } | ||||||
|         if ($request->input('is_commission')) { |         if ($request->input('is_commission')) { | ||||||
|             $orderModel->where('invite_user_id', '!=', NULL); |             $orderModel->where('invite_user_id', '!=', NULL); | ||||||
|             $orderModel->whereIn('status', [3, 4]); |             $orderModel->whereIn('status', '!=', [0, 2]); | ||||||
|             $orderModel->where('commission_balance', '>', 0); |             $orderModel->where('commission_balance', '>', 0); | ||||||
|         } |         } | ||||||
|         if ($request->input('id')) { |         if ($request->input('id')) { | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ class StatController extends Controller | |||||||
|             'data' => [ |             'data' => [ | ||||||
|                 'month_income' => Order::where('created_at', '>=', strtotime(date('Y-m-1'))) |                 'month_income' => Order::where('created_at', '>=', strtotime(date('Y-m-1'))) | ||||||
|                     ->where('created_at', '<', time()) |                     ->where('created_at', '<', time()) | ||||||
|                     ->whereIn('status', [3, 4]) |                     ->whereIn('status', '!=', [0, 2]) | ||||||
|                     ->sum('total_amount'), |                     ->sum('total_amount'), | ||||||
|                 'month_register_total' => User::where('created_at', '>=', strtotime(date('Y-m-1'))) |                 'month_register_total' => User::where('created_at', '>=', strtotime(date('Y-m-1'))) | ||||||
|                     ->where('created_at', '<', time()) |                     ->where('created_at', '<', time()) | ||||||
| @@ -35,16 +35,16 @@ class StatController extends Controller | |||||||
|                     ->count(), |                     ->count(), | ||||||
|                 'commission_pendding_total' => Order::where('commission_status', 0) |                 'commission_pendding_total' => Order::where('commission_status', 0) | ||||||
|                     ->where('invite_user_id', '!=', NULL) |                     ->where('invite_user_id', '!=', NULL) | ||||||
|                     ->where('status', [3, 4]) |                     ->whereIn('status', '!=', [0, 2]) | ||||||
|                     ->where('commission_balance', '>', 0) |                     ->where('commission_balance', '>', 0) | ||||||
|                     ->count(), |                     ->count(), | ||||||
|                 'day_income' => Order::where('created_at', '>=', strtotime(date('Y-m-d'))) |                 'day_income' => Order::where('created_at', '>=', strtotime(date('Y-m-d'))) | ||||||
|                     ->where('created_at', '<', time()) |                     ->where('created_at', '<', time()) | ||||||
|                     ->whereIn('status', [3, 4]) |                     ->whereIn('status', '!=', [0, 2]) | ||||||
|                     ->sum('total_amount'), |                     ->sum('total_amount'), | ||||||
|                 'last_month_income' => Order::where('created_at', '>=', strtotime('-1 month', strtotime(date('Y-m-1')))) |                 'last_month_income' => Order::where('created_at', '>=', strtotime('-1 month', strtotime(date('Y-m-1')))) | ||||||
|                     ->where('created_at', '<', strtotime(date('Y-m-1'))) |                     ->where('created_at', '<', strtotime(date('Y-m-1'))) | ||||||
|                     ->whereIn('status', [3, 4]) |                     ->whereIn('status', '!=', [0, 2]) | ||||||
|                     ->sum('total_amount') |                     ->sum('total_amount') | ||||||
|             ] |             ] | ||||||
|         ]); |         ]); | ||||||
|   | |||||||
| @@ -141,7 +141,7 @@ class OrderService | |||||||
|     private function haveValidOrder(User $user) |     private function haveValidOrder(User $user) | ||||||
|     { |     { | ||||||
|         return Order::where('user_id', $user->id) |         return Order::where('user_id', $user->id) | ||||||
|             ->whereIn('status', [3, 4]) |             ->whereIn('status', '!=', [0, 2]) | ||||||
|             ->first(); |             ->first(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user