44 lines
882 B
PHP
44 lines
882 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class OrderCommission extends BaseModel
|
|
{
|
|
use HasFactory;
|
|
|
|
public $guarded = [];
|
|
|
|
public function main_order()
|
|
{
|
|
return $this->belongsTo(Order::class,'order_id','id');
|
|
}
|
|
|
|
public function offline_order()
|
|
{
|
|
return $this->belongsTo(OfflineOrder::class,'order_id','order_id');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function service_user()
|
|
{
|
|
return $this->belongsTo(ServiceUser::class,'user_id','user_id');
|
|
}
|
|
|
|
|
|
public function partner_wallet()
|
|
{
|
|
return $this->belongsTo(PartnerWallet::class,'user_id','user_id');
|
|
}
|
|
|
|
public function partner_commission()
|
|
{
|
|
return $this->hasOne(PartnerCommission::class,'id','order_commission_id1');
|
|
}
|
|
}
|