From 3c2ab4fe8558dce05ea100b85a7689755bbd0a43 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Thu, 13 Jan 2022 10:55:53 +0800 Subject: [PATCH] setter --- app/controller/manager/Business.php | 9 ++++++--- app/repository/BusinessRepository.php | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controller/manager/Business.php b/app/controller/manager/Business.php index 365e751..dee6c67 100644 --- a/app/controller/manager/Business.php +++ b/app/controller/manager/Business.php @@ -40,7 +40,8 @@ class Business extends Base $size = $this->request->param('size/d', 30); $whereMap = [ - ["a.state", "=", BusinessModel::state_on] + ["a.state", "=", BusinessModel::state_on], + ["b.type", "=", Account::type_business] ]; $orders = ['a.id' => 'desc']; if (!empty($keyword)) { @@ -265,10 +266,12 @@ class Business extends Base - $whereMap = [["a.state", "in", [BusinessModel::state_reviewing, BusinessModel::state_off]]]; + $whereMap = [ + ["a.state", "in", [BusinessModel::state_reviewing, BusinessModel::state_off]], + ["b.type", "=", Account::type_consumer] + ]; //如果是渠道商或者工作人员 只查看自己的下级商家 if(Member::is_agency($this->auth['roles'])){ - $whereMap[] = ['a.agency_code', '=', $this->auth['business_code']]; } $orders = ['a.id' => 'desc']; diff --git a/app/repository/BusinessRepository.php b/app/repository/BusinessRepository.php index 80c70b8..b45a873 100644 --- a/app/repository/BusinessRepository.php +++ b/app/repository/BusinessRepository.php @@ -42,7 +42,6 @@ class BusinessRepository extends Repository { $q = $this->model->alias("a") ->join("account b", "a.code = b.business_code") - ->where("b.type","=",Account::type_consumer) ->field(["a.code as business_code", "b.avatar_url", "b.nick_name as account_nick_name",