|
|
@@ -61,13 +61,19 @@ class Withdraw extends Controller
|
|
|
|
|
|
$totalAmount = (float)$query->where($where)
|
|
|
->whereDate('created_at', date('Y-m-d'))->sum('amount');
|
|
|
- $totalSuccess = (float)$query->where($where)->whereDate('created_at', date('Y-m-d'))
|
|
|
- ->whereIn('status', [1,2])->sum('amount');
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $result = ['totalSuccess'=>$totalSuccess,'total_amount' => $totalAmount, 'total' => $count, 'data' => $list];
|
|
|
+ $totalSuccess = (float)$query->where($where)->whereDate('created_at', date('Y-m-d'))
|
|
|
+ ->whereIn('status', [1, 2])->sum('amount');
|
|
|
+ $totalFail = (float)$query->where($where)->whereDate('created_at', date('Y-m-d'))
|
|
|
+ ->where('status', 3)->sum('amount');
|
|
|
+
|
|
|
+
|
|
|
+ $result = [
|
|
|
+ 'totalFail' => $totalFail,
|
|
|
+ 'totalSuccess' => $totalSuccess,
|
|
|
+ 'total_amount' => $totalAmount,
|
|
|
+ 'total' => $count,
|
|
|
+ 'data' => $list
|
|
|
+ ];
|
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|