|
...
|
...
|
@@ -116,14 +116,14 @@ class ImageController |
|
|
|
'path' => $url.$filename,
|
|
|
|
'created_at' => date('Y-m-d H:i:s',time()),
|
|
|
|
'size' => $res->getSize(),
|
|
|
|
'hash' => $hash.$filename,
|
|
|
|
'hash' => $hash,
|
|
|
|
'type'=>$files->getClientOriginalExtension(),
|
|
|
|
];
|
|
|
|
$rs = $imageModel->add($data);
|
|
|
|
if ($rs === false) {
|
|
|
|
return $this->response('添加失败', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
return $hash.$filename;
|
|
|
|
return $hash;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* 生成缩略图缓存
|
|
...
|
...
|
@@ -162,10 +162,10 @@ class ImageController |
|
|
|
'path' => $url.$filename,
|
|
|
|
'created_at' => date('Y-m-d H:i:s',time()),
|
|
|
|
'size' => $res->getSize(),
|
|
|
|
'hash' => $hash.$filename,
|
|
|
|
'hash' => $hash,
|
|
|
|
'type'=>$files->getClientOriginalExtension(),
|
|
|
|
];
|
|
|
|
$data[] = $hash.$filename;
|
|
|
|
$data[] = $hash;
|
|
|
|
}
|
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$imageModel->insert($save_data);
|
...
|
...
|
|