| xqd
@@ -213,11 +213,12 @@ class InfoController extends Controller
|
|
|
}else{
|
|
|
// 更新是视频不存在则删除
|
|
|
$dream = $this->repository->find(request('id'));
|
|
|
+ if (is_file('.'.str_replace(getenv('APP_URL'),'',$dream->video))) {
|
|
|
+ unlink('.'.str_replace(getenv('APP_URL'),'',$dream->video));
|
|
|
+ }
|
|
|
$dream->video = '';
|
|
|
$dream->save();
|
|
|
-// dd($dream);
|
|
|
}
|
|
|
-// dd(request("file"));
|
|
|
if (!empty($pics)) {
|
|
|
// 图片不为空
|
|
|
$old_data_pics = $this->repository->find(request('id'))->imgs->toArray();
|
| xqd
@@ -247,7 +248,11 @@ class InfoController extends Controller
|
|
|
DreamImages::insert($arr);
|
|
|
}
|
|
|
}
|
|
|
- $ok = $this->repository->update(request('id'),$data);
|
|
|
+ if (request("file")) {
|
|
|
+ $ok = $this->repository->update(request('id'),$data);
|
|
|
+ }else{
|
|
|
+ $ok=1;
|
|
|
+ }
|
|
|
if ($data['status'] == 1) { //审核通过
|
|
|
$message = '你的梦想《'.$data['name'].'》已被批准,离你实现梦想又更进一步啦~ ';
|
|
|
$info = [
|