master
wangxinglong 2022-01-13 10:55:53 +08:00
parent 4ea5b959b3
commit 3c2ab4fe85
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,8 @@ class Business extends Base
$size = $this->request->param('size/d', 30); $size = $this->request->param('size/d', 30);
$whereMap = [ $whereMap = [
["a.state", "=", BusinessModel::state_on] ["a.state", "=", BusinessModel::state_on],
["b.type", "=", Account::type_business]
]; ];
$orders = ['a.id' => 'desc']; $orders = ['a.id' => 'desc'];
if (!empty($keyword)) { 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'])){ if(Member::is_agency($this->auth['roles'])){
$whereMap[] = ['a.agency_code', '=', $this->auth['business_code']]; $whereMap[] = ['a.agency_code', '=', $this->auth['business_code']];
} }
$orders = ['a.id' => 'desc']; $orders = ['a.id' => 'desc'];

View File

@ -42,7 +42,6 @@ class BusinessRepository extends Repository
{ {
$q = $this->model->alias("a") $q = $this->model->alias("a")
->join("account b", "a.code = b.business_code") ->join("account b", "a.code = b.business_code")
->where("b.type","=",Account::type_consumer)
->field(["a.code as business_code", ->field(["a.code as business_code",
"b.avatar_url", "b.avatar_url",
"b.nick_name as account_nick_name", "b.nick_name as account_nick_name",