我遇到了一個問題,我從來沒有經歷過加油。Fuelphp ORM相關限制被忽略
在用戶個人資料頁面上,我允許其他用戶發表評論。 而當我在我的控制器功能中使用related comments limit
時,我們忽略了它。
代碼
public function action_view($id)
{
$user = Model_User::find($id, array(
'related' => array(
'comments' => array(
'order_by' => array(
array('id', 'DESC'),
),
),
),
'limit' => 5,
));
if(empty($user)):
Response::redirect(Uri::base() . "welcome/404");
endif;
$this->template->title = $user->username . "'s Profile | " . Config::get('site_name');
$this->template->content = View::forge('user/profile', array('user' => $user));
}
的order_by
的作品就像一個魅力,但限制犯規,但仍列出了所有的評論。 嘗試多種變化有很多不同的奇怪的錯誤。
你能從車的配置使「剖析」?所以你可以查看創建的整個查詢,我們可以分析它。 –