如下一个uniquery查询:
SELECT a.id,a.userid,a.name,
if(a.completed='T',CONCAT('<a class="icons" href="#',a.id,'" title="',a.subject,'"> ',a.subject,'</a>'),
CONCAT('<a class="iconsf" href="#',a.id,'" title="',a.subject,'"> ',a.subject,'</a>')) subject,
b.FullName,getusernamebyid(a.modifieduserid) lastuser,DATE_FORMAT(a.modifiedon,'%y-%c-%e-%k:%i') modifiedon,a.workflowinstancekey,a.workflowdefinitionkey,if(a.completed='T',CONCAT('<p15>',c.status,'</p15>'),CONCAT('<p7>',c.status,'</p7>')) statu,completed FROM wstaskinstance a,users b,taskstlist c WHERE a.userid=b.UserID and a.id=c.id
使用到unidbgrid上正常;
但是,加一个排序后的如下查询:
SELECT a.id,a.userid,a.name,
if(a.completed='T',CONCAT('<a class="icons" href="#',a.id,'" title="',a.subject,'"> ',a.subject,'</a>'),
CONCAT('<a class="iconsf" href="#',a.id,'" title="',a.subject,'"> ',a.subject,'</a>')) subject,
b.FullName,getusernamebyid(a.modifieduserid) lastuser,DATE_FORMAT(a.modifiedon,'%y-%c-%e-%k:%i') modifiedon,a.workflowinstancekey,a.workflowdefinitionkey,if(a.completed='T',CONCAT('<p15>',c.status,'</p15>'),CONCAT('<p7>',c.status,'</p7>')) statu,completed FROM wstaskinstance a,users b,taskstlist c WHERE a.userid=b.UserID and a.id=c.id
order by completed
则使unidbgrid的subject列变为memo类型而不能正常显示,不知道是什么原因。
解决办法:
不在uniquery组件的sql语句中使用order by,而在uniquery的indexfieldnames属性值指定排序字段,如indexfieldnames:='completed;modifiedon desc',
则问题可以解决。