From 9671bc9229d218468a8745b48d0e1e3698281f6f Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 13 Sep 2023 09:54:10 +0800 Subject: [PATCH] 1 --- application/api/controller/Journal.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Journal.php b/application/api/controller/Journal.php index 25b1218..3969793 100644 --- a/application/api/controller/Journal.php +++ b/application/api/controller/Journal.php @@ -1822,8 +1822,13 @@ class Journal extends Controller { $where_str = ''; if ($data['key1'] == 'author') { - $arts = $this->article_author_obj->where('state', 0)->where('author_name', 'like', '%' . trim($data['val1']) . '%')->column('article_id'); + $arts = $this->article_author_obj->where('state', 0)->where('author_name|email', 'like', '%' . trim($data['val1']) . '%')->column('article_id'); $a_str = '(' . implode(',', $arts) . ')'; + if($a_str=="()"){ + $cre['articles'] = []; + $cre['count'] = 0; + return jsonSuccess($cre); + } $where_str = '(article_id in ' . $a_str; } else { $where_str = '(' . $data['key1'] . ' like "%' . $data['val1'] . '%"';