From f9efecb50f9077495afe2f2608758c0d27d70345 Mon Sep 17 00:00:00 2001 From: limu Date: Tue, 19 Dec 2023 16:51:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/user/UserPartnerRepository.php | 5 +++-- route/admin/user.php | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/user/UserPartnerRepository.php b/app/common/repositories/user/UserPartnerRepository.php index 6ae49dd..4a4d278 100644 --- a/app/common/repositories/user/UserPartnerRepository.php +++ b/app/common/repositories/user/UserPartnerRepository.php @@ -75,7 +75,8 @@ class UserPartnerRepository extends BaseRepository /** @var UserLabelRepository $make */ $list = $this->dao->getAll($uid)->column('partner_id') ?? []; $data = ['partner_id' => $list, 'uid' => $uid]; - return Elm::createForm(Route::buildUrl('systemUserChangePartner', compact('uid'))->build(), [ + $url = 'sys/user/partner/'.$uid; + $res = Elm::createForm($url, [ Elm::input('uid', '用户 ID', '')->disabled(true)->required(true), Elm::selectMultiple('partner_id', '用户合作人角色')->options(function () { $partnerForm = new PartnerDao(); @@ -88,7 +89,7 @@ class UserPartnerRepository extends BaseRepository return $options; }), ])->setTitle('编辑合作人角色')->formData($data); - //return compact('list', 'option'); + return $res; } public function editPartner(int $uid, array $partner_id = []) diff --git a/route/admin/user.php b/route/admin/user.php index 8470ba6..04d7f6a 100644 --- a/route/admin/user.php +++ b/route/admin/user.php @@ -184,8 +184,10 @@ Route::group(function () { //合作人角色 Route::get('partner/:id', '/getPartner')->name('systemUserGetPartner')->option([ '_alias' => '获取合作人角色', + '_auth' => false, + '_form' => 'systemUserChangePartner', ]); - Route::post('partner/edit', '/changePartner')->name('systemUserChangePartner')->option([ + Route::post('partner/:id', '/changePartner')->name('systemUserChangePartner')->option([ '_alias' => '用户合作人角色编辑', ]);