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 @ 2018-04-15 14:10  壁虎漫步.  阅读(233)  评论(0编辑  收藏  举报