how to use “find_in_set” in cakephp find method

前端 未结 1 986
情深已故
情深已故 2020-12-18 04:42

I have a table in which comma seprated id of another table i want to use the following query in cakephp in proper form with find function

\"select * from s         


        
相关标签:
1条回答
  • 2020-12-18 05:09

    Use like this

    $data = $this->SpecialOffer->find('all',array('conditions' => array('SpecialOffer.user_id' => $userId ,'FIND_IN_SET(\''. $storeId .'\',SpecialOffer.stores1)')));
    

    Hope this may help you

    0 讨论(0)
提交回复
热议问题