84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
网上查了很多资料,基本上是原生方法,或者是只能查询一条:
以上为例,是否可以查询该表中所有数据的"_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];
这是最后的解决办法,但是感觉好笨。