mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 04:41:06 +03:30
fix status
This commit is contained in:
+4
-3
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use App\Constants\StatusTypeEnum;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Package extends Model
|
||||
{
|
||||
public $fillable = [ 'name' , 'user_id' , 'note' , 'verified' , 'creator_id' ];
|
||||
public $fillable = [ 'name' , 'user_id' , 'note' , 'status' , 'creator_id' ];
|
||||
|
||||
public function user()
|
||||
{
|
||||
@@ -30,11 +31,11 @@ class Package extends Model
|
||||
|
||||
public function transfers()
|
||||
{
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , "approved" );
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED );
|
||||
}
|
||||
|
||||
public function transferActive()
|
||||
{
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , "approved" )->whereNull( "to_date" );
|
||||
return $this->morphMany( 'App\Transfer' , "transferable" )->where( "status" , StatusTypeEnum::APPROVED )->whereNull( "to_date" );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user