codigo actual del servidor, con avances de joan
This commit is contained in:
58
app/Models/Order.php
Normal file
58
app/Models/Order.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
public function orderDetails()
|
||||
{
|
||||
return $this->hasMany(OrderDetail::class);
|
||||
}
|
||||
|
||||
public function refund_requests()
|
||||
{
|
||||
return $this->hasMany(RefundRequest::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function shop()
|
||||
{
|
||||
return $this->hasOne(Shop::class, 'user_id', 'seller_id');
|
||||
}
|
||||
|
||||
public function pickup_point()
|
||||
{
|
||||
return $this->belongsTo(PickupPoint::class);
|
||||
}
|
||||
|
||||
public function carrier()
|
||||
{
|
||||
return $this->belongsTo(Carrier::class);
|
||||
}
|
||||
|
||||
public function affiliate_log()
|
||||
{
|
||||
return $this->hasMany(AffiliateLog::class);
|
||||
}
|
||||
|
||||
public function club_point()
|
||||
{
|
||||
return $this->hasMany(ClubPoint::class);
|
||||
}
|
||||
|
||||
public function delivery_boy()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'assign_delivery_boy', 'id');
|
||||
}
|
||||
|
||||
public function proxy_cart_reference_id()
|
||||
{
|
||||
return $this->hasMany(ProxyPayment::class)->select('reference_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user