diff --git a/app/controller/manager/Business.php b/app/controller/manager/Business.php index 95bb43a..365e751 100644 --- a/app/controller/manager/Business.php +++ b/app/controller/manager/Business.php @@ -268,6 +268,7 @@ class Business extends Base $whereMap = [["a.state", "in", [BusinessModel::state_reviewing, BusinessModel::state_off]]]; //如果是渠道商或者工作人员 只查看自己的下级商家 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 10967b4..80c70b8 100644 --- a/app/repository/BusinessRepository.php +++ b/app/repository/BusinessRepository.php @@ -42,8 +42,7 @@ class BusinessRepository extends Repository { $q = $this->model->alias("a") ->join("account b", "a.code = b.business_code") - ->join("category c", "a.type = c.id","left") - ->where("b.type","=",Account::type_business) + ->where("b.type","=",Account::type_consumer) ->field(["a.code as business_code", "b.avatar_url", "b.nick_name as account_nick_name", @@ -56,7 +55,7 @@ class BusinessRepository extends Repository "a.business_address", "a.business_license", "a.state", - "c.name as type_name", + "a.type_name", ]) ->group("a.id"); $data = [