From 237fb150f602b56654f27e7d4db72a5666ef597b Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Sat, 2 Sep 2023 21:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E7=AB=A0=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/lists/article/ArticleLists.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/adminapi/lists/article/ArticleLists.php b/app/adminapi/lists/article/ArticleLists.php index 1fe95c690..56d8b2ba2 100755 --- a/app/adminapi/lists/article/ArticleLists.php +++ b/app/adminapi/lists/article/ArticleLists.php @@ -73,12 +73,9 @@ class ArticleLists extends BaseAdminDataLists implements ListsSearchInterface, L */ public function lists(): array { - $query = Article::where($this->searchWhere); + $query = Article::where($this->searchWhere); if($this->adminInfo['root']!=1){ - $companyIds = CompanyLogic::getAllCompanyIds(); - if (!empty($companyIds)) { - $query->whereIn('company_id', $companyIds); - } + $query->where('company_id', $this->adminInfo['company_id']); } $ArticleLists = $query->with(['company']) @@ -99,7 +96,11 @@ class ArticleLists extends BaseAdminDataLists implements ListsSearchInterface, L */ public function count(): int { - return Article::where($this->searchWhere)->count(); + $query = Article::where($this->searchWhere); + if($this->adminInfo['root']!=1){ + $query->where('company_id', $this->adminInfo['company_id']); + } + return $query->count(); } public function extend()