1. CakePHP如何给查询时添加conditions,'!='要前置,
(1)数据库sql语句如下:
SELECT * FROM stat_clienttype WHERE stat_clienttype_name <> 'Not In Use';
(2)Controller里代码如下:
$statClientTypes = $this->StatClientType->find('list', array(
'fields'=>array('stat_clienttype_id','stat_clienttype_name'),
'conditions'=>array('stat_clienttype_name !=' => 'Not In Use'),
'order'=>'stat_clienttype_name',
'recursive'=>0
));