Commit cca90f22 cca90f222a3f2203b98d6e78f9c8482a05f90070 by lemon

上传文件

1 parent 3bed3d31
...@@ -11,7 +11,7 @@ class PropertyTrackFile extends BaseModel ...@@ -11,7 +11,7 @@ class PropertyTrackFile extends BaseModel
11 protected $guarded = []; 11 protected $guarded = [];
12 12
13 public $hidden = [ 13 public $hidden = [
14 'deleted_at', 'updated_at', 'from', 'id', 'pt_id' 14 'deleted_at', 'updated_at', 'from', 'id', 'pt_id', 'file_id',
15 ]; 15 ];
16 16
17 /** 17 /**
...@@ -22,8 +22,19 @@ class PropertyTrackFile extends BaseModel ...@@ -22,8 +22,19 @@ class PropertyTrackFile extends BaseModel
22 return $this->belongsTo(PropertyTrack::class, 'id', 'pft_id'); 22 return $this->belongsTo(PropertyTrack::class, 'id', 'pft_id');
23 } 23 }
24 24
25 /**
26 * @return HasMany
27 */
25 public function ptfTypes(): HasMany 28 public function ptfTypes(): HasMany
26 { 29 {
27 return $this->hasMany(PropertyTrackFileType::class, 'p_file_id', 'id'); 30 return $this->hasMany(PropertyTrackFileType::class, 'p_file_id', 'id');
28 } 31 }
32
33 /**
34 * @return BelongsTo
35 */
36 public function file()
37 {
38 return $this->belongsTo(FileMap::class, 'file_id');
39 }
29 } 40 }
......
...@@ -10,7 +10,7 @@ class PropertyTrackFileType extends BaseModel ...@@ -10,7 +10,7 @@ class PropertyTrackFileType extends BaseModel
10 protected $guarded = []; 10 protected $guarded = [];
11 11
12 protected $hidden = [ 12 protected $hidden = [
13 'pt_id', 'p_file_id', 'p_type_id' 13 'pt_id', 'p_file_id', 'p_type_id','id',
14 ]; 14 ];
15 15
16 /** 16 /**
......
...@@ -72,10 +72,8 @@ class PropertyTrackService extends Service ...@@ -72,10 +72,8 @@ class PropertyTrackService extends Service
72 */ 72 */
73 public function file() 73 public function file()
74 { 74 {
75 $trackFiles = PropertyTrackFile::query()->with('ptfTypes.type:id,type_name,remark')->where(['pt_id'=>$this->request->input('track_id')])->get(); 75 $trackFiles = PropertyTrackFile::query()->with('ptfTypes.type:id,type_name,remark')->where(['pt_id'=>$this->request->input('track_id')])
76 echo $trackFiles; 76 ->paginate($this->pageSize);
77 exit();
78
79 77
80 return Response::success($trackFiles); 78 return Response::success($trackFiles);
81 } 79 }
......