[置顶] 自己动手写 PHP acts_as_taggable_on 实现
写道
这个功能不怎么好总结,看了很多PHP相关的资料 感觉都木有讲清楚,ZF和orm的实现又过于臃肿....
只好 参阅rails的acts_as_taggable_on 说白了 核心就一个sql
select post.*,count(tag.id) as count
from post,tag,taging
where post.id!={当前post.id} #排除自身
and
原创
2016-08-25 17:11:13 ·
187 阅读 ·
0 评论