|
|
@@ -627,12 +627,8 @@ export default {
|
|
|
var maxAge
|
|
|
repostCurd('sql', sql).then((res) => {
|
|
|
const { data = [] } = res.variables || {}
|
|
|
- maxAge = data.reduce((max, person) => {
|
|
|
- // 将age从字符串转换为数字
|
|
|
- const maxNum = parseInt(person.bao_gao_zhou_qi_g)
|
|
|
- // 使用三元表达式比较并更新最大值
|
|
|
- return maxNum > max ? maxNum : max
|
|
|
- }, 0)
|
|
|
+ maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
|
|
|
+
|
|
|
const currentDate = new Date()
|
|
|
|
|
|
// 创建一个新的日期对象,表示当前日期加上3天
|
|
|
@@ -898,12 +894,8 @@ export default {
|
|
|
var maxAge
|
|
|
repostCurd('sql', sql).then((res) => {
|
|
|
const { data = [] } = res.variables || {}
|
|
|
- maxAge = data.reduce((max, person) => {
|
|
|
- // 将age从字符串转换为数字
|
|
|
- const maxNum = parseInt(person.bao_gao_zhou_qi_g)
|
|
|
- // 使用三元表达式比较并更新最大值
|
|
|
- return maxNum > max ? maxNum : max
|
|
|
- }, 0)
|
|
|
+ maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
|
|
|
+
|
|
|
const currentDate = new Date()
|
|
|
|
|
|
// 创建一个新的日期对象,表示当前日期加上3天
|