2
假設下表:cakephp的中可容納條件問題
- businesses_locations(location_state_id)
- users_locations(location_state_id)
- businesses_reviews(USER_ID,business_id)。
BusinessesReview上的'find'調用應該如何選擇只有那些用戶在業務狀態中出現DIFFERS的條目?
$this->BusinessesReview->contain(array('BusinessesProfile'=>array('BusinessesLocation'),'User'=>array('UsersLocation')));
$results = $this->BusinessesReview->find('all', array('conditions'=>array('BusinessesLocation.location_state_id <> UsersLocation.location_state_id')));
給出了錯誤:
MySQL Error: 1054: Unknown column 'BusinessesLocation.location_state_id'
它似乎更近一步,現在我得到:未知的列'UsersLocation.location_state_id'在'where子句'..任何想法? :) – raver