diff --git a/vendor/antgoods/goods/src/controllers/GoodsController.php b/vendor/antgoods/goods/src/controllers/GoodsController.php index 7180f54..ce4d2a2 100644 --- a/vendor/antgoods/goods/src/controllers/GoodsController.php +++ b/vendor/antgoods/goods/src/controllers/GoodsController.php @@ -29,6 +29,16 @@ class GoodsController extends Controller ]; } + public function actions() + { + return [ + 'upload' => [ + 'class' => 'iron\actions\UploadAction', + 'path' => 'xls/' + ] + ]; + } + /** * Lists all Goods models. * @return mixed diff --git a/vendor/antgoods/goods/src/views/goods/_form.php b/vendor/antgoods/goods/src/views/goods/_form.php index 713eb61..a3268b0 100644 --- a/vendor/antgoods/goods/src/views/goods/_form.php +++ b/vendor/antgoods/goods/src/views/goods/_form.php @@ -16,6 +16,12 @@ use antgoods\goods\models\ars\Supplier; + = $form->field($model, 'image')->widget(\iron\widgets\Upload::className(), [ + 'url' => 'upload', + 'deleteUrl' => 'imageDel', + 'dragdropWidth'=> 800 + ]) ?> + = $form->field($model, 'cat_id')->dropDownList(Category::modelColumn(), ['prompt' => '请选择']) ?> = $form->field($model, 'brand_id')->dropDownList(Brand::modelColumn(), ['prompt' => '请选择']) ?> @@ -56,12 +62,6 @@ use antgoods\goods\models\ars\Supplier; = $form->field($model, 'description')->textarea(['rows' => 6]) ?> - = $form->field($model, 'image')->widget(\iron\widgets\Upload::className(), [ - 'url' => 'upload', - 'deleteUrl' => 'imageDel', - 'dragdropWidth'=> 800 - ]) ?> - = $form->field($model, 'model_id')->textInput() ?> = $form->field($model, 'is_sale')->radioList($model::$isSale) ?> diff --git a/vendor/iron/widgets/Upload.php b/vendor/iron/widgets/Upload.php index 0842c80..5c8f546 100644 --- a/vendor/iron/widgets/Upload.php +++ b/vendor/iron/widgets/Upload.php @@ -201,15 +201,17 @@ SCRIPT; */ protected function renderUploadHtml() { - return '