正在显示
1 个修改的文件
包含
2 行增加
和
5 行删除
| @@ -175,7 +175,7 @@ class ImageController | @@ -175,7 +175,7 @@ class ImageController | ||
| 175 | $hash = hash_file('md5', $file->getPathname()); | 175 | $hash = hash_file('md5', $file->getPathname()); |
| 176 | $image_hash = $imageModel->read(['hash'=>$hash]); | 176 | $image_hash = $imageModel->read(['hash'=>$hash]); |
| 177 | if($image_hash !== false){ | 177 | if($image_hash !== false){ |
| 178 | - $data[] = $hash; | 178 | + $data['images'][] = $hash; |
| 179 | continue; | 179 | continue; |
| 180 | } | 180 | } |
| 181 | $url = $this->path; | 181 | $url = $this->path; |
| @@ -192,7 +192,7 @@ class ImageController | @@ -192,7 +192,7 @@ class ImageController | ||
| 192 | 'hash' => $hash, | 192 | 'hash' => $hash, |
| 193 | 'type'=>$file->getClientOriginalExtension(), | 193 | 'type'=>$file->getClientOriginalExtension(), |
| 194 | ]; | 194 | ]; |
| 195 | - $data[] = $hash; | 195 | + $data['images'][] = $hash; |
| 196 | } | 196 | } |
| 197 | $imageModel->insert($save_data); | 197 | $imageModel->insert($save_data); |
| 198 | return $this->response('图片资源',Code::SUCCESS,['images'=>$data]); | 198 | return $this->response('图片资源',Code::SUCCESS,['images'=>$data]); |
| @@ -242,8 +242,6 @@ class ImageController | @@ -242,8 +242,6 @@ class ImageController | ||
| 242 | $data[$k] = ''; | 242 | $data[$k] = ''; |
| 243 | continue; | 243 | continue; |
| 244 | } | 244 | } |
| 245 | - var_dump($data); | ||
| 246 | - die(); | ||
| 247 | //获取操作人 | 245 | //获取操作人 |
| 248 | switch ((string) $k) { | 246 | switch ((string) $k) { |
| 249 | case 'image': | 247 | case 'image': |
| @@ -251,7 +249,6 @@ class ImageController | @@ -251,7 +249,6 @@ class ImageController | ||
| 251 | break; | 249 | break; |
| 252 | case 'images': | 250 | case 'images': |
| 253 | $v = explode(',',$v); | 251 | $v = explode(',',$v); |
| 254 | - | ||
| 255 | foreach ($v as $k1=>$v1){ | 252 | foreach ($v as $k1=>$v1){ |
| 256 | $data['images_link'][$k1] = url('/b/image/' . $v1); | 253 | $data['images_link'][$k1] = url('/b/image/' . $v1); |
| 257 | } | 254 | } |
-
请 注册 或 登录 后发表评论