SELECT title,url,updatetime,description,gonggao FROM dr_1_whdt where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_fybl where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_fyxy where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_zhy where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_whmc where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_whdl where gonggao=\'[\"1\"]\') UNION (SELECT title,url,updatetime,description,gonggao FROM dr_1_mjmz where gonggao=\'[\"1\"]\') ORDER BY updatetime LIMIT 2
后来用自定义sql来完成的,但是系统默认自定义sql是不支持UNION的,要把语句过滤关闭掉;还有自定义语句解析很不完善,不支持like 不支持union 不支持双层双引号(单层双引号可以用\转移符实现),不支持单引号,转移符也不行例如下面我需要获取gonggao值为["1"]的记录,怎么也无法完成like \"%1%\" 报错= \'[\"1\"]\' 报错= '"["1"]"' 报错各种尝试,各种报错,很多在数据库可以执行的语句,到模板里就不行,sql判断和单双引号处理有问题