|
...
|
...
|
@@ -46,6 +46,8 @@ class ImageController extends Controller |
|
|
|
1 => 'image_product',
|
|
|
|
2 => 'image_news',
|
|
|
|
3 => 'image_blog',
|
|
|
|
4 => 'image_product_icon',
|
|
|
|
5 => 'image_product_cate',
|
|
|
|
0 => 'image_other',
|
|
|
|
];
|
|
|
|
|
|
...
|
...
|
@@ -150,7 +152,7 @@ class ImageController extends Controller |
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$image_hash = $imageModel->read(['hash'=>$hash]);
|
|
|
|
if($image_hash !== false){
|
|
|
|
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash]);
|
|
|
|
return $this->response('图片资源',Code::SUCCESS,['image'=>$hash,'image_link'=>$this->getImageUrl($hash)]);
|
|
|
|
}
|
|
|
|
$url = $this->config['root'].$this->path;
|
|
|
|
$fileName = uniqid().rand(10000,99999).'.'.$image_type;
|
|
...
|
...
|
@@ -295,9 +297,10 @@ class ImageController extends Controller |
|
|
|
*/
|
|
|
|
public function getImageList(){
|
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$lists = $imageModel->list([],$order = 'id',['id','hash','type','path','created_at']);
|
|
|
|
$lists = $imageModel->list($this->param,$order = 'id',['id','hash','type','path','created_at']);
|
|
|
|
foreach ($lists as $k => $v){
|
|
|
|
$v['image_link'] = $this->getImageUrl($v['image']);
|
|
|
|
$v['image_link'] = $this->getImageUrl($v['hash']);
|
|
|
|
$lists[$k] = $v;
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
...
|
...
|
|