<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Res\Core; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\ArrayUtil; use ModStart\Widget\TextLink; use Module\MemberFav\Biz\AbstractMemberFavBiz; class ResMemberFavBiz extends AbstractMemberFavBiz { const NAME = 'res_asset'; public function name() { return self::NAME; } public function title() { return '收藏的资源'; } public function memberMenu() { return array('title' => '资源', 'icon' => 'list', 'sort' => 100, 'children' => array(array('title' => '收藏的资源', 'url' => modstart_web_url('member_fav/' . self::name())))); } public function memberTitle() { return '收藏的资源'; } public function memberGridItem($jIWZA) { $COR6w = ModelUtil::get('res_asset', $jIWZA['bizId']); return TextLink::primary(htmlspecialchars($COR6w['title']), modstart_web_url('res/' . $COR6w['hash']), 'target="_blank"'); } public function memberRecords($wKMoW) { goto OQ4UL; OQ4UL: ModelUtil::join($wKMoW, 'bizId', '_asset', 'res_asset', 'id'); goto b3s1L; niSwe: foreach ($wKMoW as $jIWZA) { goto yfFIO; Syz8W: $lpVAI['style'] = 'coverTitle'; goto CSHtI; CSHtI: $lpVAI['title'] = '[已删除资源]'; goto WMfNw; yfFIO: $lpVAI = ArrayUtil::keepKeys($jIWZA, array('biz', 'bizId', 'created_at')); goto Syz8W; mOULU: $sX2oK[] = $lpVAI; goto OFVHF; TG6UI: if (!empty($jIWZA['_asset'])) { goto bUXaP; PMfPT: $lpVAI['cover'] = AssetsUtil::fixFull($jIWZA['_asset']['cover']); goto U0Oqy; U0Oqy: $lpVAI['url'] = '/pages/res/show?hash=' . $jIWZA['_asset']['hash']; goto nQRqb; bUXaP: $lpVAI['title'] = $jIWZA['_asset']['title']; goto PMfPT; nQRqb: } goto mOULU; WMfNw: $lpVAI['cover'] = AssetsUtil::fixFull('asset/image/none.svg'); goto KMWrL; KMWrL: $lpVAI['url'] = ''; goto TG6UI; OFVHF: } goto JMbTn; b3s1L: $sX2oK = array(); goto niSwe; JMbTn: return $sX2oK; goto D_uI_; D_uI_: } }