<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Field; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Util\ArrayUtil; use ModStart\Field\AutoRenderedFieldValue; use ModStart\Field\Type\FieldRenderMode; use Module\Member\Util\MemberUtil; class AutoRenderedMemberUsersField { public static function make($Pu6nD, $w6bW5) { switch ($Pu6nD) { case FieldRenderMode::GRID: case FieldRenderMode::DETAIL: $o34FH = array_map(function ($YaV4m) { return '<span class="ub-tag sm">' . htmlspecialchars($YaV4m) . '</span>'; }, MemberUtil::listViewName($w6bW5['memberUserIds'])); return AutoRenderedFieldValue::make(join(' ', $o34FH)); case FieldRenderMode::FORM: goto kh7b3; eyDmP: $fstQg = array_map(function ($YaV4m) { return array('value' => intval($YaV4m['id']), 'name' => MemberUtil::viewName($YaV4m), 'avatar' => AssetsUtil::fixOrDefault($YaV4m['avatar'], 'asset/image/avatar.svg')); }, $fstQg); goto HiFnP; kh7b3: $fstQg = MemberUtil::listUsers($w6bW5['memberUserIds']); goto asDn0; asDn0: $f_h4I = ArrayUtil::flatItemsByKey($fstQg, 'id'); goto eyDmP; HiFnP: return AutoRenderedFieldValue::makeView('module::Member.View.field.memberUsers', array('memberUserIds' => $f_h4I, 'memberUsers' => $fstQg, 'param' => $w6bW5)); goto R68ND; R68ND: } } }