$type_id = 31; echo Db::name('ymtype')->where('parent_id', $type_id)->fetchSql()->select(); //打印查询语句 $results = Db::name('ymtype')->where('parent_id', $type_id)->select(); echo count($results); // 显示结果数量,