作者 邓超

x

... ... @@ -232,7 +232,7 @@ class MailListV2 extends Base {
/************ 2024-09-02 *************/
// 查询列表数据
$lists = db()->all(sprintf($sql,$filed)." order by `udate` desc limit {$limit} offset ".(($page-1)*$limit));
$lists = db()->all(sprintf($sql,$filed).(empty($where['flagged'])?'':' group by `udate`')." order by `udate` desc limit {$limit} offset ".(($page-1)*$limit));
// map
$lists = array_map(function ($v){
... ... @@ -255,7 +255,7 @@ class MailListV2 extends Base {
},$lists?:[]);
// 总数
$total = db()->cache($this->cache)->count(sprintf($sql,"count(*)"));
$total = db()->cache($this->cache)->count(sprintf($sql,"count(*)").(empty($where['flagged'])?'':' group by `udate`'));
app()->_json(listsPage($lists,$total,$page,$limit));
... ... @@ -357,7 +357,7 @@ class MailListV2 extends Base {
unset($where['folder_id']);
$where['email_id'] = $emails;
unset($where['is_hots']);
$flaggedCount = db()->cache($this->cache)->count("select count(*) from `lists` where " . dbWhere($where));
$flaggedCount = db()->cache($this->cache)->count("select count(*) from `lists` where " . dbWhere($where).' group by `udate`');
}
$data = [];
... ...