Thinkphp3.2.3打印上一句执行的sql语句

2022-01-10 10:11:26 浏览数 (1)

代码语言:javascript复制
$num = M('joinactivity as a')->join('fh_activity as b on b.a_id = a.a_id')->where($where)->count();
echo M('joinactivity as a')->_sql();

SELECT COUNT(*) AS tp_count FROM fh_joinactivity as a INNER JOIN fh_activity as b on b.a_id = a.a_id WHERE a.u_id = 1 AND a.is_read = 0 AND b.a_time < 1486556237 LIMIT 1

0 人点赞