Image.php 671 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\admin\controller\index;
  3. use app\admin\controller\BaseController;
  4. class Image extends BaseController
  5. {
  6. public function readImg(){
  7. $id = $this->request->get('id');
  8. $returns = array();
  9. $path = "./public/storage/goods-img/" . $id;
  10. $files = scandir($path);
  11. for($i = 0; $i < count($files); $i++){
  12. if($files[$i] != "." && $files[$i] != ".." && strtolower($files[$i]) != "cover.jpg"){
  13. $returns[] = "http://op.wanyuewellness.cn/storage/goods-img/".$id."/".$files[$i];
  14. }
  15. }
  16. return json_encode($returns);
  17. }
  18. }