关于findAll的问题,新手提问!

#1 hbf85435055

我想在findAll中的conditions中使用多个查询条件,条件关系是“or”,该怎么写啊?类似的sql语句是:


select * from tb_user 
where userName='张%' or userId='01%'

2010-05-17 18:26:43

#2 woweibawang

这个用findSQL函数可以实现吧,用findall函数可以吗?等高手来回答了

2010-05-17 18:41:42

#3 jake

findAll的$conditions(第一个参数)是可以用字符串的,上面的SQL可以是:

findAll(" userName='张%' or userId='01%' ")

2010-05-17 20:23:23

#4 hbf85435055

多谢!我试试!

2010-05-18 08:15:06