Skip to content

Commit

Permalink
修复后台权限个别情况下判断失效和增加插件商户映射字段说明
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyan74 committed Mar 12, 2020
1 parent 4af26d7 commit ec702fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 113 deletions.
3 changes: 2 additions & 1 deletion common/models/common/Addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function rules()
[['name', 'title', 'group', 'version', 'author'], 'required'],
['name', 'match', 'pattern' => '/^[_a-zA-Z]+$/', 'message' => '标识由英文和下划线组成'],
[
['is_setting', 'is_rule', 'status', 'created_at', 'updated_at'],
['is_setting', 'is_merchant_route_map', 'is_rule', 'status', 'created_at', 'updated_at'],
'integer',
],
[['title', 'group', 'version'], 'string', 'max' => 20],
Expand Down Expand Up @@ -89,6 +89,7 @@ public function attributeLabels()
'is_rule' => '嵌入规则',
'is_setting' => '全局设置项',
'is_mini_program' => 'Api/小程序',
'is_merchant_route_map' => '商户映射',
'bootstrap' => '启动',
'console' => '控制台',
'default_config' => '默认配置',
Expand Down
85 changes: 0 additions & 85 deletions services/merchant/BankAccountService.php

This file was deleted.

26 changes: 0 additions & 26 deletions services/merchant/CommissionWithdrawService.php

This file was deleted.

8 changes: 7 additions & 1 deletion services/rbac/AuthRoleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use common\helpers\ArrayHelper;
use common\helpers\TreeHelper;
use common\models\rbac\AuthRole;
use common\enums\AppEnum;
use yii\web\UnauthorizedHttpException;

/**
Expand Down Expand Up @@ -45,11 +46,16 @@ public function getRole()
throw new UnauthorizedHttpException('未授权角色,请联系管理员');
}

$merchant_id = $this->getMerchantId();
if (Yii::$app->id == AppEnum::BACKEND) {
$merchant_id = '';
}

$assignment = ArrayHelper::toArray($assignment);
$this->roles = AuthRole::find()
->where(['id' => $assignment['role_id']])
->andWhere(['status' => StatusEnum::ENABLED])
->andFilterWhere(['merchant_id' => $this->getMerchantId()])
->andFilterWhere(['merchant_id' => $merchant_id])
->asArray()
->one();

Expand Down

0 comments on commit ec702fe

Please sign in to comment.