用法:
$map['parentid'] =2;
$listdata = $M->where($map)->distinct(true)->field('id ,name')->select();
var_dump(lastsql());
结果:
<small>string</small> <font color='#cc0000'>'SELECT DISTINCT `id`,`name` FROM `wp_shop_goods_category` '</font> <i>(length=59)</i>