Commit 441b563f 441b563ff48fed9cc7fafc9dc38709d8a4767f49 by lemon

修复上传保存后状态

1 parent fc30708a
......@@ -261,11 +261,11 @@ class PropertyTrackService extends Service
DB::transaction(function () use ($fileTypes){
$upload_user = PropertyShare::query()->where(['id'=>$this->request->get('id')])->pluck('phone')->first();
$upload_user = PropertyShare::query()->where(['id'=>$this->request->offsetGet('id')])->pluck('phone')->first();
//property_track_files
$res = PropertyTrackFile::query()->create([
'pt_id' => $this->request->get('track_id'),
'pt_id' => $this->request->offsetGet('track_id'),
'name' => $this->request->input('name'),
'size_byte' => $this->request->input('size'),
'upload_user' => $upload_user,
......@@ -276,7 +276,7 @@ class PropertyTrackService extends Service
$data = [];
foreach ($fileTypes as $tpye_id) {
$data[] = [
'pt_id' => $this->request->input('track_id'),
'pt_id' => $this->request->offsetGet('track_id'),
'p_file_id' => $res->id,
'p_type_id' => $tpye_id,
'created_at'=> $this->now,
......@@ -299,6 +299,9 @@ class PropertyTrackService extends Service
'link' => 'property',
'link_id' => $res->id,
]);
//更新上传时间和状态
PropertyTrack::query()->where(['id'=>$this->request->offsetGet('track_id')])->update(['status'=>1, 'upload_time'=>$this->now]);
});
return Response::success();
......@@ -358,6 +361,11 @@ class PropertyTrackService extends Service
'link' => 'property',
'link_id' => $res->id,
]);
//更新上传时间和状态
PropertyTrack::query()->where(['id'=>$this->request->input('track_id')])->update(['status'=>1, 'upload_time'=>$this->now]);
});
return Response::success();
......