mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: fix commission statistics
This commit is contained in:
		| @@ -2,12 +2,10 @@ | |||||||
|  |  | ||||||
| namespace App\Console\Commands; | namespace App\Console\Commands; | ||||||
|  |  | ||||||
| use App\Jobs\StatServerJob; |  | ||||||
| use Illuminate\Console\Command; | use Illuminate\Console\Command; | ||||||
| use App\Models\Order; | use App\Models\Order; | ||||||
| use App\Models\StatOrder; | use App\Models\StatOrder; | ||||||
| use App\Models\ServerLog; | use App\Models\CommissionLog; | ||||||
| use Illuminate\Support\Facades\DB; |  | ||||||
|  |  | ||||||
| class V2boardStatistics extends Command | class V2boardStatistics extends Command | ||||||
| { | { | ||||||
| @@ -50,14 +48,16 @@ class V2boardStatistics extends Command | |||||||
|     { |     { | ||||||
|         $endAt = strtotime(date('Y-m-d')); |         $endAt = strtotime(date('Y-m-d')); | ||||||
|         $startAt = strtotime('-1 day', $endAt); |         $startAt = strtotime('-1 day', $endAt); | ||||||
|         $builder = Order::where('paid_at', '>=', $startAt) |         $orderBuilder = Order::where('paid_at', '>=', $startAt) | ||||||
|             ->where('paid_at', '<', $endAt) |             ->where('paid_at', '<', $endAt) | ||||||
|             ->whereNotIn('status', [0, 2]); |             ->whereNotIn('status', [0, 2]); | ||||||
|         $orderCount = $builder->count(); |         $orderCount = $orderBuilder->count(); | ||||||
|         $orderAmount = $builder->sum('total_amount'); |         $orderAmount = $orderBuilder->sum('total_amount'); | ||||||
|         $builder = $builder->whereNotNull('actual_commission_balance'); |         $commissionBuilder = CommissionLog::where('created_at', '>=', $startAt) | ||||||
|         $commissionCount = $builder->count(); |             ->where('created_at', '<', $endAt) | ||||||
|         $commissionAmount = $builder->sum('actual_commission_balance'); |             ->where('get_amount', '>', 0); | ||||||
|  |         $commissionCount = $commissionBuilder->count(); | ||||||
|  |         $commissionAmount = $commissionBuilder->sum('get_amount'); | ||||||
|         $data = [ |         $data = [ | ||||||
|             'order_count' => $orderCount, |             'order_count' => $orderCount, | ||||||
|             'order_amount' => $orderAmount, |             'order_amount' => $orderAmount, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user