作者 邓超

fob

@@ -163,6 +163,32 @@ class MailList extends Base { @@ -163,6 +163,32 @@ class MailList extends Base {
163 } 163 }
164 164
165 165
  166 + /**
  167 + * 统计收件箱的数量
  168 + * @author:dc
  169 + * @time 2024/7/19 10:15
  170 + */
  171 + public function count(){
  172 + $emails = $this->getEmails(['id']);
  173 +
  174 + $sql = "select count(*) from `fob_hot_mail` where ";
  175 +
  176 + $where = ['email_id'=>$emails];
  177 + // 收件箱
  178 + $where['folder'] = 's';
  179 + $sCount = db()->count($sql.dbWhere($where));
  180 + // 发件箱
  181 + $where['folder'] = 'f';
  182 + $fCount = db()->count($sql.dbWhere($where));
  183 +
  184 + app()->_json([
  185 + 's_count'=> $sCount,
  186 + 'f_count'=> $fCount,
  187 + ]);
  188 +
  189 + }
  190 +
  191 +
166 192
167 } 193 }
168 194
@@ -16,6 +16,7 @@ return [ @@ -16,6 +16,7 @@ return [
16 'v2/lists' => [\Controller\v2\Home::class, 'lists'], 16 'v2/lists' => [\Controller\v2\Home::class, 'lists'],
17 // 黑格专用路由 17 // 黑格专用路由
18 'fob/lists' => [\Controller\fob_ai\MailList::class, 'lists'], 18 'fob/lists' => [\Controller\fob_ai\MailList::class, 'lists'],
  19 + 'fob/count' => [\Controller\fob_ai\MailList::class, 'count'],// 统计数量
19 20
20 // 邮件详情 21 // 邮件详情
21 'info' => [\Controller\Home::class, 'info'], 22 'info' => [\Controller\Home::class, 'info'],