背调优化

发邮件记录添加姓名和邮箱模糊搜索
This commit is contained in:
wyn
2026-06-05 13:52:35 +08:00
parent 752494dbdb
commit 1d54946fef
6 changed files with 243 additions and 11 deletions

View File

@@ -2130,6 +2130,7 @@ class EmailClient extends Base
$state = $this->request->param('state', '-1');
$page = max(1, intval($this->request->param('page', 1)));
$perPage = max(1, min(intval($this->request->param('per_page', 50)), 200));
$keyword = trim($this->request->param('keyword', ''));
if (!$taskId) {
return jsonError('task_id is required');
@@ -2139,7 +2140,9 @@ class EmailClient extends Base
if ($state !== '-1' && $state !== '') {
$where['l.state'] = intval($state);
}
if ($keyword !== '') {
$where['e.email|e.name'] = ['like',"%".trim($keyword)."%"];
}
$total = Db::name('promotion_email_log')->alias('l')->where($where)->count();
$list = Db::name('promotion_email_log')->alias('l')
->join('t_expert e', 'l.expert_id = e.expert_id', 'LEFT')