Commit 451443230fdf57b1a3164450d6a216bdeca74428
1 parent
91ce5647
Exists in
master
domain
1. F 删除升级版本的时候路径调整出错
Showing
1 changed file
with
5 additions
and
3 deletions
Show diff stats
domain/upgrade/Upgrade.php
... | ... | @@ -166,12 +166,14 @@ class Upgrade |
166 | 166 | } |
167 | 167 | $path = $upgradeModel->path; |
168 | 168 | $uploadPath = $upgradeModel->upload_path; |
169 | - $localRoot = Yii::getAlias('@app/ht'); | |
170 | - unlink($localRoot.'/'.$uploadPath); | |
169 | + $localRoot = Yii::getAlias('@app/api'); | |
170 | + if (file_exists($localRoot.'/'.$uploadPath)) { | |
171 | + unlink($localRoot.'/'.$uploadPath); | |
172 | + } | |
173 | + | |
171 | 174 | $fileService = new FileService(); |
172 | 175 | $fileService->delete($path); |
173 | 176 | |
174 | - | |
175 | 177 | return UpgradeModel::updateAll(["is_delete" => 1, 'path' => null, 'upload_path' => null], ["id" => $id]); |
176 | 178 | } |
177 | 179 | } |
178 | 180 | \ No newline at end of file | ... | ... |