修复上传保存后状态
Showing
1 changed file
with
11 additions
and
3 deletions
... | @@ -261,11 +261,11 @@ class PropertyTrackService extends Service | ... | @@ -261,11 +261,11 @@ class PropertyTrackService extends Service |
261 | 261 | ||
262 | DB::transaction(function () use ($fileTypes){ | 262 | DB::transaction(function () use ($fileTypes){ |
263 | 263 | ||
264 | $upload_user = PropertyShare::query()->where(['id'=>$this->request->get('id')])->pluck('phone')->first(); | 264 | $upload_user = PropertyShare::query()->where(['id'=>$this->request->offsetGet('id')])->pluck('phone')->first(); |
265 | 265 | ||
266 | //property_track_files | 266 | //property_track_files |
267 | $res = PropertyTrackFile::query()->create([ | 267 | $res = PropertyTrackFile::query()->create([ |
268 | 'pt_id' => $this->request->get('track_id'), | 268 | 'pt_id' => $this->request->offsetGet('track_id'), |
269 | 'name' => $this->request->input('name'), | 269 | 'name' => $this->request->input('name'), |
270 | 'size_byte' => $this->request->input('size'), | 270 | 'size_byte' => $this->request->input('size'), |
271 | 'upload_user' => $upload_user, | 271 | 'upload_user' => $upload_user, |
... | @@ -276,7 +276,7 @@ class PropertyTrackService extends Service | ... | @@ -276,7 +276,7 @@ class PropertyTrackService extends Service |
276 | $data = []; | 276 | $data = []; |
277 | foreach ($fileTypes as $tpye_id) { | 277 | foreach ($fileTypes as $tpye_id) { |
278 | $data[] = [ | 278 | $data[] = [ |
279 | 'pt_id' => $this->request->input('track_id'), | 279 | 'pt_id' => $this->request->offsetGet('track_id'), |
280 | 'p_file_id' => $res->id, | 280 | 'p_file_id' => $res->id, |
281 | 'p_type_id' => $tpye_id, | 281 | 'p_type_id' => $tpye_id, |
282 | 'created_at'=> $this->now, | 282 | 'created_at'=> $this->now, |
... | @@ -299,6 +299,9 @@ class PropertyTrackService extends Service | ... | @@ -299,6 +299,9 @@ class PropertyTrackService extends Service |
299 | 'link' => 'property', | 299 | 'link' => 'property', |
300 | 'link_id' => $res->id, | 300 | 'link_id' => $res->id, |
301 | ]); | 301 | ]); |
302 | |||
303 | //更新上传时间和状态 | ||
304 | PropertyTrack::query()->where(['id'=>$this->request->offsetGet('track_id')])->update(['status'=>1, 'upload_time'=>$this->now]); | ||
302 | }); | 305 | }); |
303 | 306 | ||
304 | return Response::success(); | 307 | return Response::success(); |
... | @@ -358,6 +361,11 @@ class PropertyTrackService extends Service | ... | @@ -358,6 +361,11 @@ class PropertyTrackService extends Service |
358 | 'link' => 'property', | 361 | 'link' => 'property', |
359 | 'link_id' => $res->id, | 362 | 'link_id' => $res->id, |
360 | ]); | 363 | ]); |
364 | |||
365 | |||
366 | //更新上传时间和状态 | ||
367 | PropertyTrack::query()->where(['id'=>$this->request->input('track_id')])->update(['status'=>1, 'upload_time'=>$this->now]); | ||
368 | |||
361 | }); | 369 | }); |
362 | 370 | ||
363 | return Response::success(); | 371 | return Response::success(); | ... | ... |
-
Please register or sign in to post a comment