master
cody 8 months ago
parent 9050f96579
commit 996e5e1179

@ -100,7 +100,7 @@ class OrdersController extends CommonController
$query->with(["room", "building", "area"]); $query->with(["room", "building", "area"]);
}, },
"orderAgreements" => function ($query) { "orderAgreements" => function ($query) {
$query->orderBy("id", "desc"); $query->with('file')->orderBy("id", "desc");
} }
])->where('status', $status) ])->where('status', $status)
->where(function ($query) use ($building_id, $area_id) { ->where(function ($query) use ($building_id, $area_id) {

@ -6,5 +6,11 @@ class Uploads extends SoftDeletesModel
{ {
protected $table = "uploads"; protected $table = "uploads";
protected $appends = ['url'];
public function getUrlAttribute()
{
return '/'.$this->attributes['folder'].'/'.$this->name;
}
} }

@ -86,7 +86,7 @@
<td> <td>
{{ $row->serial }} {{ $row->serial }}
</td> </td>
<td>{{isset($row->orderAgreements)?$row->orderAgreements[0]->file_id:""}}112</td> <td>{{isset($row->orderAgreements)?$row->orderAgreements[0]->file->url:""}}112</td>
<td>{{ $row->project->name }}</td> <td>{{ $row->project->name }}</td>
<td>{{ $row->bed->building->name }}</td> <td>{{ $row->bed->building->name }}</td>

Loading…
Cancel
Save