<?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($VIe63, $EPwwc) { switch ($VIe63) { case FieldRenderMode::GRID: case FieldRenderMode::DETAIL: $aTYBN = array_map(function ($Z32UA) { return '<span class="ub-tag sm">' . htmlspecialchars($Z32UA) . '</span>'; }, MemberUtil::listViewName($EPwwc['memberUserIds'])); return AutoRenderedFieldValue::make(join(' ', $aTYBN)); case FieldRenderMode::FORM: goto H0IfE; rsIqq: $khjor = ArrayUtil::flatItemsByKey($sHpVc, 'id'); goto t5DJf; t5DJf: $sHpVc = array_map(function ($Z32UA) { return array('value' => intval($Z32UA['id']), 'name' => MemberUtil::viewName($Z32UA), 'avatar' => AssetsUtil::fixOrDefault($Z32UA['avatar'], 'asset/image/avatar.svg')); }, $sHpVc); goto nZC4q; nZC4q: return AutoRenderedFieldValue::makeView('module::Member.View.field.memberUsers', array('memberUserIds' => $khjor, 'memberUsers' => $sHpVc, 'param' => $EPwwc)); goto Tc1gz; H0IfE: $sHpVc = MemberUtil::listUsers($EPwwc['memberUserIds']); goto rsIqq; Tc1gz: } } }