角色站位调整

main
limu 11 months ago
parent 0c5afe6524
commit f2a5f5bece
  1. 7
      app/common/repositories/user/UserPartnerRepository.php

@ -73,17 +73,16 @@ class UserPartnerRepository extends BaseRepository
public function changePartnerForm($uid) public function changePartnerForm($uid)
{ {
/** @var UserLabelRepository $make */ /** @var UserLabelRepository $make */
$list = $this->dao->getAll($uid)->column('partner_id') ?? []; $list = UserPartner::getDB()->where('uid',$uid)->column('id') ?? [];
$data = ['partner_id' => $list, 'uid' => $uid]; $data = ['partner_id' => $list, 'uid' => $uid];
$url = 'sys/user/partner/' . $uid; $url = 'sys/user/partner/' . $uid;
$res = Elm::createForm($url, [ $res = Elm::createForm($url, [
Elm::input('uid', '用户 ID', '')->disabled(true)->required(true), Elm::input('uid', '用户 ID', '')->disabled(true)->required(true),
Elm::selectMultiple('partner_id', '用户合作人角色')->options(function () { Elm::selectMultiple('partner_id', '用户合作人角色')->options(function () {
$partnerForm = new PartnerDao(); $data = UserPartner::getDB()->select()->toArray();
$data = $partnerForm->getAll();
foreach ($data as $value => $label) { foreach ($data as $value => $label) {
$name = (string)$label['id']; $name = (string)$label['id'];
$value = $label['name']; $value = $label['partner_name'];
$options[] = compact('value', 'name'); $options[] = compact('value', 'name');
} }
return $options; return $options;

Loading…
Cancel
Save