mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 19:51:07 +03:30
fix
This commit is contained in:
+8
-3
@@ -31,16 +31,21 @@ class Package extends Model
|
||||
|
||||
public function transfersAll()
|
||||
{
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" );
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->orderBy("id" , "desc");
|
||||
}
|
||||
|
||||
public function transfers()
|
||||
{
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED );
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->orderBy("id" , "desc");
|
||||
}
|
||||
|
||||
public function latestTransfer()
|
||||
{
|
||||
return $this->morphOne( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->orderBy("id" , "desc")->latest();
|
||||
}
|
||||
|
||||
public function transferActive()
|
||||
{
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->whereNull( "to_date" );
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->whereNull( "to_date" )->orderBy("id" , "desc");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user