api doctor detail
This commit is contained in:
@@ -18,6 +18,25 @@ class Practice extends Model
|
||||
'deleted_by'
|
||||
];
|
||||
|
||||
// public $appends = [
|
||||
// 'price'
|
||||
// ];
|
||||
|
||||
// public function getPriceAttribute()
|
||||
// {
|
||||
// $orgPrice = [];
|
||||
// foreach ($this->prices as $price) {
|
||||
// $orgPrice[$this->service_code] = $price->price_net;
|
||||
// }
|
||||
|
||||
// return $orgPrice;
|
||||
// }
|
||||
|
||||
public function getPriceAttribute()
|
||||
{
|
||||
return $this->prices->where('priceable_id', $this->id)->max('price_net');
|
||||
}
|
||||
|
||||
public function prices()
|
||||
{
|
||||
return $this->morphMany(Price::class, 'priceable');
|
||||
|
||||
Reference in New Issue
Block a user