|
@@ -6,6 +6,7 @@ use App\Constants\HttpStatus;
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Controllers\Controller;
|
|
|
use App\Models\PaymentOrder;
|
|
use App\Models\PaymentOrder;
|
|
|
use App\Models\Recharge;
|
|
use App\Models\Recharge;
|
|
|
|
|
+use App\Models\User;
|
|
|
use App\Services\PaymentOrderService;
|
|
use App\Services\PaymentOrderService;
|
|
|
use Illuminate\Validation\ValidationException;
|
|
use Illuminate\Validation\ValidationException;
|
|
|
use Exception;
|
|
use Exception;
|
|
@@ -27,9 +28,13 @@ class Home extends Controller
|
|
|
$end = request()->input('end_date');
|
|
$end = request()->input('end_date');
|
|
|
if (empty($end)) $end = date('Y-m-d');
|
|
if (empty($end)) $end = date('Y-m-d');
|
|
|
if (empty($start)) $start = date('Y-m-d');
|
|
if (empty($start)) $start = date('Y-m-d');
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
$end = Carbon::createFromFormat('Y-m-d', $end)->addDay()->format('Y-m-d');
|
|
$end = Carbon::createFromFormat('Y-m-d', $end)->addDay()->format('Y-m-d');
|
|
|
|
|
+
|
|
|
|
|
+ //新增会员统计
|
|
|
|
|
+ $query = User::query();
|
|
|
|
|
+ $query->where('from','<>',2)->whereBetween('created_at', [$start, $end]);
|
|
|
|
|
+ $totalUser = (float)$query->count('id');
|
|
|
|
|
+
|
|
|
$query = PaymentOrder::query();
|
|
$query = PaymentOrder::query();
|
|
|
$query->whereBetween('created_at', [$start, $end]);
|
|
$query->whereBetween('created_at', [$start, $end]);
|
|
|
$query1 = clone $query;
|
|
$query1 = clone $query;
|
|
@@ -104,7 +109,8 @@ class Home extends Controller
|
|
|
'total_amount' => $totalAmount,
|
|
'total_amount' => $totalAmount,
|
|
|
'total_processing' => $totalProcessing,
|
|
'total_processing' => $totalProcessing,
|
|
|
'total_pending' => $totalPending
|
|
'total_pending' => $totalPending
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'total_user' => $totalUser,
|
|
|
|
|
|
|
|
];
|
|
];
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|