<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Shop\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Exception\BizException; use ModStart\Core\Input\InputPackage; use ModStart\Form\Form; use ModStart\Repository\Filter\RepositoryFilter; use ModStart\Support\Concern\HasFields; class Goods3dImageController extends Controller { public static $PermitMethodMap = array('*' => '\\Module\\Shop\\Admin\\Controller\\GoodsController@index'); use HasAdminQuickCRUD; private $goodsId; public function __construct() { goto lb02O; lb02O: $Km8YS = InputPackage::buildFromInput(); goto EkllH; EkllH: $this->goodsId = $Km8YS->getInteger('goodsId'); goto Id6No; i1jPk: BizException::throwsIfEmpty('商品不存在', $z62M8); goto LGTDR; Id6No: $z62M8 = ModelUtil::get('goods', $this->goodsId); goto i1jPk; FF2fh: $this->setGridPageUrlParam(array('goodsId' => $this->goodsId)); goto oymCU; LGTDR: $this->useGridDialogPage(); goto FF2fh; oymCU: } protected function crud(AdminCRUDBuilder $P2vse) { $P2vse->init('goods_3d_image')->field(function ($P2vse) { $P2vse->id('id', 'ID'); $P2vse->image('image', '图片'); $P2vse->display('created_at', L('Created At'))->listable(false); $P2vse->display('updated_at', L('Updated At'))->listable(false); })->repositoryFilter(function (RepositoryFilter $mHisM) { $mHisM->where('goodsId', $this->goodsId); })->hookSaved(function (Form $NX6uw) { $YaV4m = $NX6uw->item(); ModelUtil::update('goods_3d_image', $YaV4m->id, array('goodsId' => $this->goodsId)); })->title('3D旋转图')->canShow(false)->canSort(true)->defaultOrder(array('sort', 'asc')); } }