62 lines
1.4 KiB
PHP
62 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Notis extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'notis';
|
|
|
|
protected $fillable = [
|
|
'tarikh_notis',
|
|
'daritempoh',
|
|
'hinggatempoh',
|
|
'sts_notis',
|
|
'fasa'
|
|
];
|
|
|
|
public function cawangan()
|
|
{
|
|
return $this->belongsToMany(Cawangan::class, 'cawangan_notis', 'notis_id', 'caw_id')->withPivot('status');
|
|
}
|
|
|
|
public function cawanganNotis()
|
|
{
|
|
return $this->hasMany(cawanganNotis::class, 'notis_id');
|
|
}
|
|
|
|
public function notisBid()
|
|
{
|
|
return $this->hasMany(NotisBid::class, 'notis_id', 'id');
|
|
}
|
|
|
|
// public function lelongBidJual()
|
|
// {
|
|
// return $this->hasMany(LelongBid::class, 'lelong_id', 'id')->where('status_jual', 1);
|
|
// }
|
|
|
|
// public function lelongBidBelumSemak()
|
|
// {
|
|
// return $this->hasMany(LelongBid::class, 'lelong_id', 'id')->where('status_semak', 0);
|
|
// }
|
|
|
|
// public function lelKarat()
|
|
// {
|
|
// return $this->hasMany(LelKarat::class, 'lelong_id', 'id');
|
|
// }
|
|
|
|
// public function pengesahan()
|
|
// {
|
|
// return $this->hasMany(Pengesahan::class, 'lelong_id', 'id');
|
|
// }
|
|
|
|
// public function pengesahanTelahSah()
|
|
// {
|
|
// return $this->hasMany(Pengesahan::class, 'lelong_id', 'id')->whereNotNull('disahkan_oleh');
|
|
// }
|
|
}
|