This commit is contained in:
Hankin 2026-06-11 11:49:52 +08:00
parent b5eb8f17da
commit 3a582114f3
2 changed files with 5 additions and 3 deletions

View File

@ -851,7 +851,7 @@ class OrderController extends Controller
return $this->failure("用户不存在");
$fatService = new FatService();
$res = $fatService->getFatStat($name, $start_date, $end_date, $user);
$res = $fatService->getFatStat($name, $start_date, $end_date, $user, "");
if (!$res['status']) {
return $this->failure($res['msg']);

View File

@ -1150,7 +1150,7 @@ class FatService
* @param $end_date
* @return array
*/
public function getFatStat($name, $start_date, $end_date, $user)
public function getFatStat($name, $start_date, $end_date, $user, $unit = "")
{
if ($start_date && $end_date) {
// 将日期时间字符串转换为 Carbon 实例
@ -1169,7 +1169,9 @@ class FatService
}
$user_id = $user->id;
$type = $user->fat_device;
if (empty($unit)) {
$unit = $user->unit;
}
$language = $user->language;
$x_arr = [];
$y_arr = [];