| 123456789101112131415161718192021 |
- <?php
- namespace App\Models\Agent;
- use App\Models\BaseModel;
- use Illuminate\Database\Eloquent\Builder;
- class AgentManualCreditLock extends BaseModel
- {
- public const REFERENCE_TYPE = 'agent_manual_credit_lock';
- public const LOCK_DAYS = 7;
- protected $table = 'agent_manual_credit_locks';
- protected $fillable = ['agent_id', 'amount', 'remaining', 'unlock_at', 'released_at'];
- protected $casts = ['amount' => 'decimal:4', 'remaining' => 'decimal:4', 'unlock_at' => 'datetime', 'released_at' => 'datetime'];
- public function scopePending(Builder $query): Builder
- {
- return $query->whereNull('released_at')->where('remaining', '>', 0);
- }
- }
|