Commit cca90f22 cca90f222a3f2203b98d6e78f9c8482a05f90070 by lemon

上传文件

1 parent 3bed3d31
......@@ -11,7 +11,7 @@ class PropertyTrackFile extends BaseModel
protected $guarded = [];
public $hidden = [
'deleted_at', 'updated_at', 'from', 'id', 'pt_id'
'deleted_at', 'updated_at', 'from', 'id', 'pt_id', 'file_id',
];
/**
......@@ -22,8 +22,19 @@ class PropertyTrackFile extends BaseModel
return $this->belongsTo(PropertyTrack::class, 'id', 'pft_id');
}
/**
* @return HasMany
*/
public function ptfTypes(): HasMany
{
return $this->hasMany(PropertyTrackFileType::class, 'p_file_id', 'id');
}
/**
* @return BelongsTo
*/
public function file()
{
return $this->belongsTo(FileMap::class, 'file_id');
}
}
......
......@@ -10,7 +10,7 @@ class PropertyTrackFileType extends BaseModel
protected $guarded = [];
protected $hidden = [
'pt_id', 'p_file_id', 'p_type_id'
'pt_id', 'p_file_id', 'p_type_id','id',
];
/**
......
......@@ -72,10 +72,8 @@ class PropertyTrackService extends Service
*/
public function file()
{
$trackFiles = PropertyTrackFile::query()->with('ptfTypes.type:id,type_name,remark')->where(['pt_id'=>$this->request->input('track_id')])->get();
echo $trackFiles;
exit();
$trackFiles = PropertyTrackFile::query()->with('ptfTypes.type:id,type_name,remark')->where(['pt_id'=>$this->request->input('track_id')])
->paginate($this->pageSize);
return Response::success($trackFiles);
}
......