shish 6 лет назад
Родитель
Сommit
a8801d1edc
2 измененных файлов с 20 добавлено и 2 удалено
  1. 12 1
      app/business/controllers/PicController.php
  2. 8 1
      biz/goods/services/PicService.php

+ 12 - 1
app/business/controllers/PicController.php

@@ -72,6 +72,7 @@ class PicController extends BaseController
 		util::ok('备注成功');
 		util::ok('备注成功');
 	}
 	}
 	
 	
+	//查看图片详情 shish 2019.12.8
 	public function actionDetail()
 	public function actionDetail()
 	{
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$id = Yii::$app->request->get('id', 0);
@@ -80,5 +81,15 @@ class PicController extends BaseController
 		$pic = PicService::getPic($info);
 		$pic = PicService::getPic($info);
 		util::success($pic);
 		util::success($pic);
 	}
 	}
-	
+
+	//删除图片 shish 2019.12.8
+	public function actionDelete()
+	{
+		$id = Yii::$app->request->get('id', 0);
+		$info = PicService::getById($id);
+		PicService::valid($info, $this->merchantId);
+		PicService::delPic($id);
+		util::ok('删除成功');
+	}
+
 }
 }

+ 8 - 1
biz/goods/services/PicService.php

@@ -34,5 +34,12 @@ class PicService extends BaseService
 		$info = business::formatPic($info);
 		$info = business::formatPic($info);
 		return $info;
 		return $info;
 	}
 	}
-
+	
+	//删除图片 shish 2019.12.8
+	public static function delPic($id)
+	{
+		PicService::deleteById($id);
+		PicCategoryService::deleteByCondition(['picId' => $id]);
+	}
+	
 }
 }