上代码比较直接。希望对大家有用,phalcon的文档是在令人诟病
$types = [1,2,3,4]
$prizeList = Prize::find([
"conditions" => 'status = ?0 and app_config_id =?1 and city_id =?2 and game_code =?3 and level =?4 and type IN ({typeList:array})',
"order" => 'get_probability DESC, sort DESC',
"bind" => [
0 => 1,
1 => GOB::APP_CONFIG_ID,
2 => $city_id,
3 => $gameCode,
4 => $this->level,
'typeList'=>$type
]
]);
使用这种查询方式就查询出类似这样的效果
select * from `prize` where type in ($typeList);