feat: 价格趋势数据按时间顺序排序

- 在处理价格趋势数据时,增加了对列表进行按时间顺序排序的步骤
- 使用 asort() 函数对 $list 数组进行排序,确保价格趋势数据按时间轴正确展示
This commit is contained in:
mkm 2025-03-14 11:59:23 +08:00
parent d367e0e49f
commit 02c96c75d7

View File

@ -281,6 +281,7 @@ class StoreProductPriceLogic extends BaseLogic
$item['price'] = $item['purchase']; $item['price'] = $item['purchase'];
} }
} }
asort($list);
$data = [ $data = [
'name' => '价格趋势', 'name' => '价格趋势',
'series' => [['name' => '价格', 'value' => array_column($list, 'price')]], 'series' => [['name' => '价格', 'value' => array_column($list, 'price')]],