|
|
|
@ -75,9 +75,14 @@ class PictureModel extends Model{
|
|
|
|
|
$saveFileName = 'icon/' . $path[4];
|
|
|
|
|
$localFilePath = '.' . $value['path'];
|
|
|
|
|
$ossService = new OssService();
|
|
|
|
|
$ossService->upload($localFilePath, $saveFileName);
|
|
|
|
|
$dataUrl['oss_url'] = $ossService->getUrl($saveFileName);
|
|
|
|
|
$coo = $this->where(['id' => $value['id']])->save($dataUrl);
|
|
|
|
|
$result = $ossService->upload($localFilePath, $saveFileName);
|
|
|
|
|
if ($result['status']) {
|
|
|
|
|
$dataUrl['oss_url'] = $ossService->getUrl($saveFileName);
|
|
|
|
|
$coo = $this->where(['id' => $value['id']])->save($dataUrl);
|
|
|
|
|
} else {
|
|
|
|
|
$this->error = $result['message'];
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $info; //文件上传成功
|
|
|
|
|