0
저는 정말 이상한 '포함'동작을하고 있습니다. $ restaurant를 주석 처리 할 때마다 $ spas는 beforeFilter()에 할당 된 데이터를 반환하지만 $ 식당의 주석을 제거하면 contains 문을 무시합니다. ($ spas 함수를 복제하고 "$ ? 레스토랑 "과 같은 일이 발생은 ..CakePHP : 이상한 행동을 포함합니다.
class CouponsController extends AppController {
public function beforeFilter() {
parent::beforeFilter();
$this->Coupon->contain(array('Vendor' => array('VendorLocation'), 'Category'));
}
public function index() {
$showPerPage = 4;
//$restaurants = $this->Coupon->findAllBycategory_id('1', '', '', $showPerPage);
$spas = $this->Coupon->find('all', array('limit' => $showPerPage, 'conditions' => array('Coupon.category_id' => 3)));
$this->set('spas', $spas);
}
'$ restaurants = $ this-> Coupon-> find ('all', array ('conditions'=> 'category_id'=> 1 ')와 같은 일반적인 찾기 쿼리로 주석 행을 변경해 보았습니까? limit '=> $ showPerPage))'? –