12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Order extends Model
- {
- public function orderDetails()
- {
- return $this->hasMany(OrderDetail::class);
- }
- public function details()
- {
- return $this->hasMany(OrderDetail::class, 'order_id');
- }
- 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 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');
- }
- }
|