|
@@ -38,13 +38,18 @@ class Home extends Controller
|
|
|
$totalFail = (float)$query1->where('status', 3)->sum('amount');
|
|
$totalFail = (float)$query1->where('status', 3)->sum('amount');
|
|
|
|
|
|
|
|
$query = Withdraw::query();
|
|
$query = Withdraw::query();
|
|
|
- $usdTotalAmount = (float)$query->whereBetween('created_at', [$start, $end])->sum('amount');
|
|
|
|
|
- $usdTotalSuccess = (float)$query->whereBetween('created_at', [$start, $end])->where('status', 1)->sum('amount');
|
|
|
|
|
- $usdTotalFail = (float)$query->whereBetween('created_at', [$start, $end])->where('status', 2)
|
|
|
|
|
|
|
+ $query->whereBetween('created_at', [$start, $end]);
|
|
|
|
|
+ $query1 = clone $query;
|
|
|
|
|
+ $usdTotalAmount = (float)$query1->sum('amount');
|
|
|
|
|
+ $query1 = clone $query;
|
|
|
|
|
+ $usdTotalSuccess = (float)$query1->where('status', 1)->sum('amount');
|
|
|
|
|
+ $query1 = clone $query;
|
|
|
|
|
+ $usdTotalFail = (float)$query1->where('status', 2)
|
|
|
->sum('amount');
|
|
->sum('amount');
|
|
|
- $sql = $query->whereBetween('created_at', [$start, $end])->where('status', 2)->toSql();
|
|
|
|
|
|
|
+ $query1 = clone $query;
|
|
|
|
|
+ $sql = $query1->where('status', 2)->toSql();
|
|
|
|
|
|
|
|
- $bindings = $query->getBindings();
|
|
|
|
|
|
|
+ $bindings = $query1->getBindings();
|
|
|
|
|
|
|
|
// 将绑定的参数替换到 SQL 查询中
|
|
// 将绑定的参数替换到 SQL 查询中
|
|
|
foreach ($bindings as $binding) {
|
|
foreach ($bindings as $binding) {
|