Fix for sql_mode=only_full_group_by
In MySQL 5.7, the default is sql_mode=only_full_group_by
This commit is contained in:
parent
2cdcd19568
commit
5aca7b110d
1 changed files with 3 additions and 3 deletions
|
@ -297,14 +297,14 @@ class Model extends DataModel
|
|||
':tid' => $this->id,
|
||||
':pid' => $pid,
|
||||
];
|
||||
$sql = 'SELECT COUNT(p.id) AS num, j.id AS flag
|
||||
$sql = 'SELECT COUNT(p.id) AS num
|
||||
FROM ::posts AS p
|
||||
INNER JOIN ::posts AS j ON (j.topic_id=?i:tid AND j.id=?i:pid)
|
||||
WHERE p.topic_id=?i:tid AND p.id<?i:pid';
|
||||
WHERE p.topic_id=?i:tid AND p.id<?i:pid'; //???? может на два запроса разбить?
|
||||
|
||||
$result = $this->c->DB->query($sql, $vars)->fetch();
|
||||
|
||||
$this->page = empty($result['flag']) ? null : (int) \ceil(($result['num'] + 1) / $this->c->user->disp_posts);
|
||||
$this->page = empty($result) ? null : (int) \ceil(($result['num'] + 1) / $this->c->user->disp_posts);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue