|
@ -104,6 +104,28 @@ class Upload extends InputWidget |
|
|
/** |
|
|
/** |
|
|
* @var |
|
|
* @var |
|
|
* 删除图片触发方法 |
|
|
* 删除图片触发方法 |
|
|
|
|
|
* $.ajax({ |
|
|
|
|
|
* url: 'img-id-del', |
|
|
|
|
|
* data: {data: data, imgid: $('#goods-image').val()}, |
|
|
|
|
|
* success: function(data) |
|
|
|
|
|
* { |
|
|
|
|
|
* $('#goods-image').val(data); |
|
|
|
|
|
* }, |
|
|
|
|
|
* }); |
|
|
|
|
|
* |
|
|
|
|
|
* 路由方法 |
|
|
|
|
|
* public function actionImgIdDel() |
|
|
|
|
|
* { |
|
|
|
|
|
* $alias = Yii::$app->request->get('data')['alias']; |
|
|
|
|
|
* $imgid = Yii::$app->request->get('imgid'); |
|
|
|
|
|
* $imgidarr = explode(',', $imgid); |
|
|
|
|
|
* $temfile = TemFile::findOne(['alias' => $alias]); |
|
|
|
|
|
* if ($temfile) { |
|
|
|
|
|
* $imgidarr = array_diff($imgidarr, [$temfile->id]); |
|
|
|
|
|
* } |
|
|
|
|
|
* $imgidstr = implode(',', $imgidarr); |
|
|
|
|
|
* return $imgidstr; |
|
|
|
|
|
* } |
|
|
*/ |
|
|
*/ |
|
|
public $deleteScript; |
|
|
public $deleteScript; |
|
|
|
|
|
|
|
|