我有标准:
object(CDbCriteria)#186 (17) {
["select"]=>
string(1) "*"
["distinct"]=>
bool(false)
["condition"]=>
string(17) "t.type IN (:type)"
["params"]=>
array(1) {
[":type"]=>
string(3) "2,3"
}
["limit"]=>
string(2) "50"
["offset"]=>
int(0)
["order"]=>
string(17) "t.order_date DESC"
["group"]=>
string(0) ""
["join"]=>
string(0) ""
["having"]=>
string(0) ""
["with"]=>
NULL
["alias"]=>
NULL
["together"]=>
NULL
["index"]=>
NULL
["scopes"]=>
NULL
["_e":"CComponent":private]=>
NULL
["_m":"CComponent":private]=>
NULL
}
我认为SQL查询必须看起来像这样:
SQL query must be SELECT * FROM `transaction` WHERE type IN (2,3);
$model::model()->findAll($criteria);
但问题在于,我只能在类型为2的情况下获取记录,但不能获得3的位置,为什么?