TP多条件查询

$stcount = M("Results_all")->alias('a')

->join("s_test_name as b on a.subject = b.sid and a.testsets = b.number",'left')

->where("a.subject = $subject and  b.name = '$testsname' ")->field("count(a.number) as cnum")

->select();

posted @ 2017-10-09 10:02  刘俊涛的博客  阅读(484)  评论(0编辑  收藏  举报