<?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\MemberLike\Biz\AbstractMemberLikeBiz; use Module\Res\Util\UrlUtil; class ResMemberLikeBiz extends AbstractMemberLikeBiz { 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_like/' . self::name())))); } public function memberTitle() { return '喜欢的资源'; } public function memberGridItem($jIWZA) { $zk4Tz = ModelUtil::get('res_asset', $jIWZA['bizId']); return TextLink::primary(htmlspecialchars($zk4Tz['title']), UrlUtil::show($zk4Tz), 'target="_blank"'); } public function memberRecords($wKMoW) { goto woSo6; lM_cF: foreach ($wKMoW as $jIWZA) { goto Q7TY1; e3K0G: if (!empty($jIWZA['_asset'])) { goto XCQA6; wH8O1: $lpVAI['cover'] = AssetsUtil::fixFull($jIWZA['_asset']['cover']); goto p15JY; p15JY: $lpVAI['url'] = '/pages/res/show?hash=' . $jIWZA['_asset']['hash']; goto LsRhV; XCQA6: $lpVAI['title'] = $jIWZA['_asset']['title']; goto wH8O1; LsRhV: } goto iSEpO; YuOTA: $lpVAI['style'] = 'coverTitle'; goto XVVUz; g1HWj: $lpVAI['cover'] = AssetsUtil::fixFull('asset/image/none.svg'); goto J6IK0; Q7TY1: $lpVAI = ArrayUtil::keepKeys($jIWZA, array('biz', 'bizId', 'created_at')); goto YuOTA; XVVUz: $lpVAI['title'] = '[已删除资源]'; goto g1HWj; J6IK0: $lpVAI['url'] = ''; goto e3K0G; iSEpO: $sX2oK[] = $lpVAI; goto Xx2cO; Xx2cO: } goto PTPmt; woSo6: ModelUtil::join($wKMoW, 'bizId', '_asset', 'res_asset', 'id'); goto O3ro7; O3ro7: $sX2oK = array(); goto lM_cF; PTPmt: return $sX2oK; goto y3YRz; y3YRz: } }