|
|
|
@ -53,6 +53,9 @@ class FinanceStatisticsController extends AdminController |
|
|
|
|
|
|
|
$dateTime = request('created_at', 0); |
|
|
|
if ($dateTime) { |
|
|
|
if (empty($dateTime['end'])) { |
|
|
|
$dateTime['end'] = date('Y-m-d'); |
|
|
|
} |
|
|
|
$price->whereBetween('created_at',[$dateTime['start'] . ' 00:00:00',$dateTime['end'].' 23:59:59']); |
|
|
|
//$costPrice->whereBetween('created_at',[$dateTime['start'] . ' 00:00:00',$dateTime['end'].' 23:59:59'])
|
|
|
|
$count->whereBetween('created_at',[$dateTime['start'] . ' 00:00:00',$dateTime['end'].' 23:59:59']); |
|
|
|
@ -85,8 +88,7 @@ class FinanceStatisticsController extends AdminController |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
->body(function (Row $row) use ($price, $profit, $count,$onlinePrice) { |
|
|
|
|
|
|
|
->body(function (Row $row) use ($price, $dateTime, $count, $onlinePrice) { |
|
|
|
|
|
|
|
$row->column(3, function (Column $column) use ($onlinePrice) { |
|
|
|
$column->row(Card::make('线上金额', function () use ($onlinePrice) { |
|
|
|
@ -108,9 +110,14 @@ HTML; |
|
|
|
})); |
|
|
|
}); |
|
|
|
|
|
|
|
$row->column(3, function (Column $column) use ($profit) { |
|
|
|
$column->row(Card::make('交易费', function () use ($profit) { |
|
|
|
$price = DepositLog::where('supplier_id', Admin::user()->id)->sum('price'); |
|
|
|
$row->column(3, function (Column $column) use ($dateTime) { |
|
|
|
$column->row(Card::make('交易费', function () use ($dateTime) { |
|
|
|
if ($dateTime) { |
|
|
|
$price = DepositLog::whereBetween('created_at', [$dateTime['start'], $dateTime['end'] . ' 23:59:59']) |
|
|
|
->where('supplier_id', Admin::user()->id)->sum('price'); |
|
|
|
} else { |
|
|
|
$price = DepositLog::where('supplier_id', Admin::user()->id)->sum('price'); |
|
|
|
} |
|
|
|
return <<<HTML |
|
|
|
<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px"> |
|
|
|
<h2 class="ml-1 font-large-1 text-primary">$price</h2> |
|
|
|
|