1
zsdsz 2014-03-06 21:52:43 +08:00 via iPhone
Getlastsql看看
|
2
no13bus OP @zsdsz SELECT topic.id AS id,topic.title AS title,topic.content AS content,topic.last_replied_by AS last_replied_by,topic.last_touched AS last_touched,topic.created AS created,last_replied_user.username AS last_replied_username,node.name AS nodename,node.slug AS nodeslug FROM mn_topic topic JOIN mn_user last_replied_user ON topic.last_replied_by=last_replied_user.uid JOIN mn_node node ON topic.node_id=node.id ORDER BY topic.last_touched desc,topic.created desc,last_replied_time desc,topic.id desc
确实没有username字段。我想说因为帖子有最后回复的人 还有发帖人。这2种人都是属于user表的。所以我在视图模型里面用了2次user表,但是最后的用_as修改了显示名称呀。为什么前面的那个user的字段出不来呢 |