【问题标题】:limit is not working in query cakephp 3限制在查询 cakephp 3 中不起作用
【发布时间】:2016-12-07 09:05:09
【问题描述】:

我正在使用以下查询来显示数据列表,但这里的限制不起作用。

$query = $this->Bookings->find('all')
    ->where(['Bookings.user_id' => $id])
    ->contain(['Services'])
    ->limit(10)
    ->orderDesc('booking_date');

$this->set('bookings', $this->paginate($query));
$this->set('_serialize', ['bookings']); 

但是,我没有得到每页中 10 个数据的列表。

【问题讨论】:

  • 试试把->orderDesc('booking_date')->limit(10);

标签: pagination cakephp-3.0


【解决方案1】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-14
    • 2016-01-26
    • 1970-01-01
    • 2013-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多