thinkphp子查询

1.根据实际情况发现子查询用->buildSql();

$where['version'] = array('between',array($version+1,$now_version-1));
$subQuery = M('charging_version')->order('id desc')->buildSql();
$lists = M()->table($subQuery.' a')->group('dd_charging_id')->where($where)->select();

你可能感兴趣的:(thinkphp子查询)