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