1$all_settings = array(
2 'limit' => 100, // limit pagination page number: 100 record / page
3 'fields' => array(
4 'Product.*',
5 ),
6 'conditions' => $conditions,
7 'order' => array(
8 'Product.is ASC',
9 ),
10 'contain' => array(
11 'ProductLanguage' => array(
12 'conditions' => array(
13 'ProductLanguage.alias' => $this->lang18,
14 ),
15 'fields' => array(
16 'ProductLanguage.title',
17 ),
18 ),
19 ),
20 'recursive' => -1,
21);
22
23$this->Paginator->settings = $all_settings;
24$products = $this->paginate();
1// admin_index
2
3$all_settings = array(
4 'contain' => array(
5 'CreditType' => array(
6 'CreditTypeLanguage' => array(
7 'conditions' => array(
8 'CreditTypeLanguage.alias' => $this->lang18, // 'zho', 'eng', 'chi'
9 ),
10 ),
11 ),
12 ),
13 'recursive' => 0,
14);
15
16$this->Paginator->settings = $all_settings;
17$companyCredits = $this->paginate();
18$this->set(compact('companyCredits'));