12345678910111213141516171819202122232425 |
- <?php
- namespace app\admin\controller\index;
- use app\admin\controller\BaseController;
- class Image extends BaseController
- {
- public function readImg(){
-
- $id = $this->request->get('id');
- $returns = array();
- $path = "./public/storage/goods-img/" . $id;
-
- $files = scandir($path);
-
- for($i = 0; $i < count($files); $i++){
- if($files[$i] != "." && $files[$i] != ".." && strtolower($files[$i]) != "cover.jpg"){
- $returns[] = "http://op.wanyuewellness.cn/storage/goods-img/".$id."/".$files[$i];
- }
- }
-
- return json_encode($returns);
- }
- }
|