作者 邓超

预热邮件

@@ -179,8 +179,10 @@ class MailListV2 extends Base { @@ -179,8 +179,10 @@ class MailListV2 extends Base {
179 $where['deleted'] = 0; 179 $where['deleted'] = 0;
180 180
181 $filed = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`'.$this->getTable().'`.`email_id`,`to_name`'; 181 $filed = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`'.$this->getTable().'`.`email_id`,`to_name`';
  182 + $filedhot = '`id`,`uid`,`subject`,`from`,`from_name`,`flagged`,`seen`,`udate`,`folder_id`,`is_file`,`description`,`lists_hot`.`email_id`,`to_name`';
182 183
183 $sql = "select %s from `".$this->getTable()."` where ".dbWhere($where); 184 $sql = "select %s from `".$this->getTable()."` where ".dbWhere($where);
  185 + $sqlhot = "select %s from `lists_hot` where ".dbWhere($where);
184 186
185 /************ 2024-09-02 *************/ 187 /************ 2024-09-02 *************/
186 if($folder=='收件箱' && empty($where['flagged']) && !$ids) { 188 if($folder=='收件箱' && empty($where['flagged']) && !$ids) {
@@ -222,7 +224,7 @@ class MailListV2 extends Base { @@ -222,7 +224,7 @@ class MailListV2 extends Base {
222 /************ 2024-09-02 *************/ 224 /************ 2024-09-02 *************/
223 225
224 // 查询列表数据 226 // 查询列表数据
225 - $lists = db()->all(sprintf($sql,$filed).(empty($where['flagged'])?'':' group by `udate`')." order by `udate` desc limit {$limit} offset ".(($page-1)*$limit)); 227 + $lists = db()->all(sprintf(empty($where['is_hots'])?$sql:$sqlhot,empty($where['is_hots'])?$filed:$filedhot).(empty($where['flagged'])?'':' group by `udate`')." order by `udate` desc limit {$limit} offset ".(($page-1)*$limit));
226 228
227 // map 229 // map
228 $lists = array_map(function ($v){ 230 $lists = array_map(function ($v){
@@ -247,7 +249,7 @@ class MailListV2 extends Base { @@ -247,7 +249,7 @@ class MailListV2 extends Base {
247 if($lists){ 249 if($lists){
248 // 总数 250 // 总数
249 if(empty($where['flagged'])){ 251 if(empty($where['flagged'])){
250 - $total = db()->cache($this->cache)->count(sprintf($sql,"count(*)")); 252 + $total = db()->cache($this->cache)->count(sprintf(empty($where['is_hots'])?$sql:$sqlhot,"count(*)"));
251 }else{ 253 }else{
252 $total = db()->cache($this->cache)->count("select count(*) from (".sprintf($sql,"`id`").' group by `udate`) as t'); 254 $total = db()->cache($this->cache)->count("select count(*) from (".sprintf($sql,"`id`").' group by `udate`) as t');
253 } 255 }