作者 邓超

优化

@@ -245,6 +245,7 @@ class MailListV2 extends Base { @@ -245,6 +245,7 @@ class MailListV2 extends Base {
245 return $v; 245 return $v;
246 },$lists?:[]); 246 },$lists?:[]);
247 247
  248 + if($lists){
248 // 总数 249 // 总数
249 if(empty($where['flagged'])){ 250 if(empty($where['flagged'])){
250 $total = db()->cache($this->cache)->count(sprintf($sql,"count(*)")); 251 $total = db()->cache($this->cache)->count(sprintf($sql,"count(*)"));
@@ -252,6 +253,10 @@ class MailListV2 extends Base { @@ -252,6 +253,10 @@ class MailListV2 extends Base {
252 $total = db()->cache($this->cache)->count("select count(*) from (".sprintf($sql,"`id`").' group by `udate`) as t'); 253 $total = db()->cache($this->cache)->count("select count(*) from (".sprintf($sql,"`id`").' group by `udate`) as t');
253 } 254 }
254 255
  256 + }else{
  257 + $total = 0;
  258 + }
  259 +
255 260
256 app()->_json(listsPage($lists,$total,$page,$limit)); 261 app()->_json(listsPage($lists,$total,$page,$limit));
257 262