完善开放数据接口中的用户数据获取

This commit is contained in:
lingwentao 2023-07-28 21:13:16 +08:00
parent afc412d369
commit 86be2efe82

View File

@ -106,15 +106,15 @@ class OpenDataMapper {
let sql
switch (type) {
case 0:
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND DATE_SUB(CURDATE(), INTERVAL 10 DAY) <= date(a.create_time) GROUP BY a.create_time'
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND TIMESTAMPDIFF(HOUR,a.create_time,now()) <= 10 GROUP BY a.create_time'
break;
case 1:
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND PERIOD_DIFF( date_format( now( ) , \'%Y%m\' ) , date_format(a.create_time, \'%Y%m\' ) ) <=10 GROUP BY a.create_time'
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND DATE_SUB(CURDATE(), INTERVAL 10 DAY) <= date(a.create_time) GROUP BY a.create_time'
break;
case 2:
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND year(a.create_time)>=year(date_sub(now(),interval 10 year)) GROUP BY a.create_time'
sql='SELECT a.create_time as time,COUNT(*) as num from szja_active_info a WHERE a.address_code = ? AND PERIOD_DIFF( date_format( now( ) , \'%Y%m\' ) , date_format(a.create_time, \'%Y%m\' ) ) <=10 GROUP BY a.create_time'
break;
}
return await db(