This commit is contained in:
xman 2025-05-16 15:01:04 +08:00
parent fe8f24543f
commit 2a38e106fa

View File

@ -49,7 +49,8 @@ class Dispatcher extends Backend
public function index() public function index()
{ {
//$this->chart(); //$this->chart();
$today = now()->format('Y-m-d'); //$today = now()->sub('')->format('Y-m-d' );
$today = now()->sub(new \DateInterval('P7D'))->format('Y-m-d');
$today_end = now()->format('Y-m-d'); $today_end = now()->format('Y-m-d');
@ -196,7 +197,6 @@ class Dispatcher extends Backend
$newData[] = $datum->toArray(); $newData[] = $datum->toArray();
} }
} }
if($getAll){ if($getAll){
return $newData; return $newData;
}else{ }else{
@ -214,6 +214,9 @@ class Dispatcher extends Backend
*/ */
private function _calc($a, $b, int $scale=4, $is_percent=false): int|string private function _calc($a, $b, int $scale=4, $is_percent=false): int|string
{ {
$a = $a??0;
$b = $b??0;
$val = $b > 0 ? bcdiv($a,$b,$scale) : 0; $val = $b > 0 ? bcdiv($a,$b,$scale) : 0;
if($is_percent){ if($is_percent){