<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Product\Api\Controller; use Illuminate\Routing\Controller; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Input\InputPackage; use ModStart\Core\Input\Response; use ModStart\Core\Util\ArrayUtil; use ModStart\Core\Util\HtmlUtil; use Module\Product\Util\ProductUtil; class ProductController extends Controller { public function latest() { goto ELWEh; ELWEh: $Cj1F4 = InputPackage::buildFromInput(); goto vo1ZX; uw0nD: $vKRZ2 = ProductUtil::listLatest($BMu21); goto c4ocb; vo1ZX: $BMu21 = $Cj1F4->getInteger('limit', 5); goto uw0nD; c4ocb: return Response::generateSuccessPaginateData(1, count($vKRZ2), $vKRZ2, count($vKRZ2)); goto oJxwb; oJxwb: } public function paginate() { goto pwQ7Z; DZU5M: if ($q2QN6) { $aY5Ol['where']['categoryId'] = $q2QN6; } goto JLpg0; WSVeF: $aY5Ol = array(); goto S2LJi; DouXz: return Response::generateSuccessData(array('page' => $qDx9U, 'pageSize' => $JDSm5, 'total' => $aNWPu['total'], 'records' => $vKRZ2)); goto sMxRm; aA4eX: $q2QN6 = $Cj1F4->getInteger('categoryId'); goto DZU5M; S2LJi: $aY5Ol['where'] = array(); goto wGLk9; m4csf: $vKRZ2 = ProductUtil::buildRecords($aNWPu['records']); goto DouXz; pwQ7Z: $Cj1F4 = InputPackage::buildFromInput(); goto g1iYY; g1iYY: $qDx9U = $Cj1F4->getPage(); goto FXAdW; JLpg0: $aNWPu = ModelUtil::paginate('product', $qDx9U, $JDSm5, $aY5Ol); goto m4csf; FXAdW: $JDSm5 = $Cj1F4->getPageSize(); goto WSVeF; wGLk9: $aY5Ol['order'] = array('id', 'desc'); goto aA4eX; sMxRm: } public function get() { goto n0Nd2; Pn2Ms: return Response::generateSuccessData($qgfZ7); goto Rel0A; n0Nd2: $WXJys = InputPackage::buildFromInput()->getInteger('id'); goto cYvU_; CMz97: $qgfZ7['content'] = $Lu5WV['content']; goto Pn2Ms; rZLMV: $qgfZ7['cover'] = $Lu5WV['cover']; goto CMz97; cYvU_: $Lu5WV = ProductUtil::get($WXJys); goto gMIVo; gMIVo: $qgfZ7 = ProductUtil::buildRecord($Lu5WV); goto rZLMV; Rel0A: } }