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