1
假設我有一張名爲'產品'的表格和名爲'產品'的型號。CakePHP的Paginate臨時表?
「產品」表有3個字段ID,名稱,價格,創造
我想計算cal_price(其中每個記錄和搜索的一天中不斷變化),並創建一個臨時表與4個字段,即ID,標題,價格,cal_price與cal_price訂單
現在,我只想要分頁這個臨時表。
using $ this-> paginate();
例如。
table_products
id title price created
3 demo1 23 2011-12-12
4 demo2 43 2011-12-13
56 demo3 26 2011-12-16
排序「temp_table」由cal_price秩序和分頁
temp_table
id title price cal_price created
3 demo1 23 12 2011-12-12
4 demo2 43 43 2011-12-13
56 demo3 26 88 2011-12-16
*潛在的問題的解決方案是怎麼做的我分配temp_table到一個模型在運行時,因爲一旦我這樣做,我可以使用$ this-> paginate('temp_model')並解決問題*
在將這項工作在這種情況? http://stackoverflow.com/questions/5675225/create-temporary-table-in-cakephp-and-load-it-as-a-model,因爲我似乎得到一個「表未找到」錯誤? – bpneal 2011-04-15 10:19:57