84669 人學習
152542 人學習
20005 人學習
5487 人學習
7821 人學習
359900 人學習
3350 人學習
180660 人學習
48569 人學習
18603 人學習
40936 人學習
1549 人學習
1183 人學習
32909 人學習
網上查了很多資料,基本上是原生方法,或是只能查詢一條:
以上為例,是否可以查詢該表中所有資料的"_id"欄位?
没有条件,然后指定查询字段
$criteria = new EMongoCriteria(); $criteria->sort('posts_count',EMongoCriteria::SORT_DESC) ->limit(25) ->offset(0); $test_id = Group::model()->findAll($criteria); $test_id->next(); $_ids = array(); $name_id = array(); while($row = $test_id->current()){ $t = $row->attributes; $name_id[] = array_splice($t,0,2); $_ids[] = $name_id; $test_id->next(); } $test_id = $_ids[count($_ids)-1]; 这是最后的解决办法,但是感觉好笨。
没有条件,然后指定查询字段
$criteria = new EMongoCriteria();
$criteria->sort('posts_count',EMongoCriteria::SORT_DESC)
->limit(25)
->offset(0);
$test_id = Group::model()->findAll($criteria);
$test_id->next();
$_ids = array();
$name_id = array();
while($row = $test_id->current()){
$t = $row->attributes;
$name_id[] = array_splice($t,0,2);
$_ids[] = $name_id;
$test_id->next();
}
$test_id = $_ids[count($_ids)-1];
这是最后的解决办法,但是感觉好笨。