【发布时间】:2018-08-15 08:29:23
【问题描述】:
我遇到了批量数据问题。我需要加入近 8 个表来获取结果,因此需要更多时间来显示结果。所以我想为此构建一个自定义 SQL 查询,我需要知道如何在 cakephp 3 中使用自定义 SQL 查询以及视图中列的排序选项进行分页。
$sql = 'SELECT t1.f1, t2.f2, t3.f1
FROM table1 as t1
left join table2 as t2 on t1.f1 = t2.f2
left join table3 as t3 on t1.f3 = t3.f1'
$results = $this->query($sql);
我需要根据这个查询对字段进行分页和排序
【问题讨论】:
标签: pagination cakephp-3.0 columnsorting