master
wangxinglong 2022-01-13 10:48:36 +08:00
parent b2ea9bcf2f
commit 4ea5b959b3
2 changed files with 3 additions and 3 deletions

View File

@ -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'];

View File

@ -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 = [