<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Product\Web\Controller; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Request; use ModStart\Core\Input\Response; use ModStart\Core\Util\PageHtmlUtil; use ModStart\Module\ModuleBaseController; use ModStart\Module\ModuleManager; use Module\Ad\Util\AdUtil; use Module\Article\Util\ArticleUtil; use Module\Product\Util\ProductUtil; class ProductController extends ModuleBaseController { private $api; public function __construct() { $this->api = app(\Module\Product\Api\Controller\ProductController::class); } public function index() { goto adN5g; NNiaC: $g5RPQ['records'] = $aNWPu['records']; goto q08df; r_jyz: $g5RPQ = array(); goto NNiaC; adN5g: $Cj1F4 = InputPackage::buildFromInput(); goto pchjm; pchjm: $aNWPu = Response::tryGetData($this->api->paginate()); goto r_jyz; q08df: $g5RPQ['categoryId'] = $Cj1F4->getInteger('categoryId'); goto uraOZ; uraOZ: $g5RPQ['categories'] = ProductUtil::listCategories(); goto IqICn; IlYGJ: if (ModuleManager::isModuleInstalled('Ad')) { $g5RPQ['ads'] = AdUtil::listByPositionWithCache('pcProductListRight'); } goto RzPuV; IqICn: $g5RPQ['pageHtml'] = PageHtmlUtil::render($aNWPu['total'], $aNWPu['pageSize'], $aNWPu['page'], '?' . Request::mergeQueries(array('page' => array('{page}')))); goto IlYGJ; RzPuV: return $this->view('product.list', $g5RPQ); goto qJeT0; qJeT0: } public function views($WXJys) { goto kFZkm; ZKkeT: $g5RPQ = array(); goto Xfhr7; pHSZS: $Lu5WV['_category'] = ModelUtil::get('product_category', array('id' => $Lu5WV['categoryId'])); goto ZKkeT; kFZkm: $Lu5WV = ProductUtil::get($WXJys); goto Bt9mq; Bt9mq: if (empty($Lu5WV)) { return Response::send(-1, '新闻不存在'); } goto pHSZS; kfQy7: return $this->view('product.view', $g5RPQ); goto TSmln; Xfhr7: $g5RPQ['record'] = $Lu5WV; goto JL0xr; JL0xr: if (ModuleManager::isModuleInstalled('Ad')) { $g5RPQ['ads'] = AdUtil::listByPositionWithCache('pcProductViewRight'); } goto kfQy7; TSmln: } }