TP3.2 group 和 count 联合使用问题
$sql = “SELECT COUNT(*) FROM (SELECT COUNT(*) FROM `ds_member` INNER JOIN ds_order ON ds_member.id = ds_order.user_id GROUP BY ds_member.id ) AS a”;
$count = M()->query($sql);
$count = $count[0] [“COUNT(*)”];
$sql = “SELECT COUNT(*) FROM (SELECT COUNT(*) FROM `ds_member` INNER JOIN ds_order ON ds_member.id = ds_order.user_id GROUP BY ds_member.id ) AS a”;
$count = M()->query($sql);
$count = $count[0] [“COUNT(*)”];