作者 邓超

tongji

@@ -408,6 +408,20 @@ class Home extends Base { @@ -408,6 +408,20 @@ class Home extends Base {
408 redis()->rPush('sync_email_lists', $v['id']); 408 redis()->rPush('sync_email_lists', $v['id']);
409 } 409 }
410 $datas[$k]['have_new'] = redis()->getDel('have_new_mail_'.$v['id']); 410 $datas[$k]['have_new'] = redis()->getDel('have_new_mail_'.$v['id']);
  411 +
  412 + // 计算
  413 + $folders = db()->all(folderSql::all($v['id'],'`id`'));
  414 + foreach ($folders as $folder){
  415 + $w = [
  416 + 'email_id' => $v['id'],
  417 + 'folder_id' => $folder['id'],
  418 + ];
  419 + db()->update(folderSql::$table,[
  420 + 'exsts' => db()->count(listsSql::listCount(dbWhere($w))),
  421 + 'unseen' => db()->count(listsSql::listCount(dbWhere(array_merge($w,['seen'=>0])))),
  422 + ],'`id` = '.$folder['id']);
  423 + }
  424 +
411 } 425 }
412 // 返回成功的参数值 426 // 返回成功的参数值
413 app()->_json($datas); 427 app()->_json($datas);