作者 lyh

gx

... ... @@ -153,7 +153,7 @@ class FileController
'path' => $url.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$files->getClientOriginalExtension(),,
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
];
$rs = $fileModel->add($data);
... ... @@ -191,7 +191,7 @@ class FileController
'path' => $url.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$files->getClientOriginalExtension(),,
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
];
$data[] = $hash;
... ...
... ... @@ -56,10 +56,6 @@ class ImageController
exit;
}
$imageModel = new ImageModel();
$dotIndex = strpos($hash, '.');
if ($dotIndex !== false) {
$hash = substr($dotIndex, 0, $dotIndex); // 删除小数点及其后面的字符
}
$info = $imageModel->read(['hash'=>$hash]);
if ($info === false) {
$this->response('指定图片不存在!', Code::USER_ERROR);
... ... @@ -139,7 +135,7 @@ class ImageController
'path' => $url.$fileName,
'created_at' => date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$files->getClientOriginalExtension(),
'hash' => $hash,
'type'=>$files->getClientOriginalExtension(),
];
$rs = $imageModel->add($data);
... ... @@ -193,7 +189,7 @@ class ImageController
'created_at' => date('Y-m-d H:i:s',time()),
'updated_at'=>date('Y-m-d H:i:s',time()),
'size' => $res->getSize(),
'hash' => $hash.$files->getClientOriginalExtension(),
'hash' => $hash,
'type'=>$file->getClientOriginalExtension(),
];
$data[] = $hash;
... ...
... ... @@ -63,6 +63,8 @@ class AyrReleaseLogic extends BaseLogic
$imageModel = new Image();
$list = $imageModel->list(['hash'=>['in',$images]],'id');
foreach ($list as $v1){
var_dump($v1);
die();
$arr[] = url('/b/images/' . $v1['hash']);
}
}else{
... ...