登陆时增加了验证码

2013年5月29日 16:00

效果图如下

继续阅读 »

这段时间记录的一些杂七杂八的笔记

2013年5月28日 17:06

ruby代码

1.upto 10 do |i|
    puts i if i==3..i==5
end

sql代码

--方法1 慢。。。。。
select postby,(select count(*) from articles where status=1 and postby=ar.postby) as art_num,(select count(*) from articles where status=1 and isgood=1 and postby=ar.postby) as goodart_num,title from articles as ar group by postby order by goodart_num desc,art_num desc limit 10

--方法2 快。。。。。
select postby,sum(case when status=1 then 1 else 0 end) as art_num,sum(case when status=1 and isgood=1 then 1 else 0 end) as goodart_num,title from articles group by postby order by goodart_num desc,art_num desc limit 10;

继续阅读 »