【发布时间】:2012-03-03 09:43:01
【问题描述】:
我有一个表,其中另一个表的逗号分隔 id 我想在 cakephp 中以适当的形式使用以下查询和查找功能
"select * from special_offers where find_in_set('".$storeId."', stores) and user_id = '". $userId ."'";
【问题讨论】:
标签: cakephp
我有一个表,其中另一个表的逗号分隔 id 我想在 cakephp 中以适当的形式使用以下查询和查找功能
"select * from special_offers where find_in_set('".$storeId."', stores) and user_id = '". $userId ."'";
【问题讨论】:
标签: cakephp
这样使用
$data = $this->SpecialOffer->find('all',array('conditions' => array('SpecialOffer.user_id' => $userId ,'FIND_IN_SET(\''. $storeId .'\',SpecialOffer.stores1)')));
希望对你有帮助
【讨论】:
FIND_IN_SET(?, SpecialOffer.stores1)' => array($storeId),