This commit is contained in:
mkm 2024-03-12 14:29:03 +08:00
parent 922bd131a6
commit f0ebabb689
3 changed files with 5 additions and 5 deletions

View File

@ -221,7 +221,7 @@ class SupplyMenuDao extends BaseDao
public function merchantTypeByOptions($typeId, $all = false)
{
return SupplyMenu::getDB()->alias('A')->leftJoin('Relevance B', 'A.menu_id = B.right_id')->where('is_mer', 1)
return SupplyMenu::getDB()->alias('A')->leftJoin('SupplyRelevance B', 'A.menu_id = B.right_id')->where('is_mer', 1)
->where('B.left_id', $typeId)->where('B.type', RelevanceRepository::TYPE_MERCHANT_AUTH)->when(!$all, function ($query) {
$query->where(function ($query) {
$query->where(function ($query) {

View File

@ -15,7 +15,7 @@ namespace app\common\repositories\system\supply;
use app\common\dao\system\supply\SupplyTypeDao;
use app\common\repositories\BaseRepository;
use app\common\repositories\system\auth\MenuRepository;
use app\common\repositories\system\auth\SupplyMenuRepository;
use app\common\repositories\system\RelevanceRepository;
use FormBuilder\Factory\Elm;
use think\exception\ValidateException;
@ -129,12 +129,12 @@ class SupplyTypeRepository extends BaseRepository
$find['auth_ids'] = $ids;
$options = [];
if ($ids) {
$paths = app()->make(MenuRepository::class)->getAllOptions(1, true,compact('ids'),'path');
$paths = app()->make(SupplyMenuRepository::class)->getAllOptions(1, true,compact('ids'),'path');
foreach ($paths as $id => $path) {
$ids = array_merge($ids, explode('/', trim($path, '/')));
array_push($ids, $id);
}
$auth = app()->make(MenuRepository::class)->getAllOptions(1, true, compact('ids'));
$auth = app()->make(SupplyMenuRepository::class)->getAllOptions(1, true, compact('ids'));
$options = formatTree($auth, 'menu_name');
}
$find['options'] = $options;

View File

@ -172,7 +172,7 @@ class SupplyMenu extends BaseController
*/
public function menus()
{
$pre = '/' . config('admin.' . ($this->merchant ? 'merchant' : 'admin') . '_prefix');
$pre = '/' . config('admin.' . ($this->merchant ? 'supply' : 'admin') . '_prefix');
$menus = $this->request->adminInfo()->level
? $this->repository->ruleByMenuList($this->request->adminRule(), $this->merchant)
: $this->repository->getValidMenuList($this->merchant);