80 lines
1.7 KiB
PHP
80 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class LelongBid extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'lelongbid';
|
|
|
|
protected $fillable = [
|
|
'lelong_id',
|
|
'caw_id',
|
|
'kodcaw',
|
|
'norujukan',
|
|
't_lelong',
|
|
'hargaasas',
|
|
'hargajual',
|
|
't_jual',
|
|
'nopembeli',
|
|
'jbg',
|
|
'kadarupah',
|
|
'upahsimpan',
|
|
'ansuran',
|
|
'nilaimarhun',
|
|
'pinjaman',
|
|
'bakiupah',
|
|
'cajlain',
|
|
'cajlelong',
|
|
'baki',
|
|
'berat',
|
|
'marhun',
|
|
'percent',
|
|
'status_jual',
|
|
'status_payment',
|
|
'mora_upah',
|
|
'fasa'
|
|
];
|
|
|
|
public function cawangan()
|
|
{
|
|
return $this->belongsTo(Cawangan::class, 'caw_id','id');
|
|
}
|
|
|
|
public function lelongbidder() {
|
|
return $this->hasOne(LelongBidder::class,'lelongbid_id', 'id' );
|
|
}
|
|
|
|
public function cawanganLelong(){
|
|
return $this->hasOne(CawanganLelong::class, 'caw_id','caw_id');
|
|
}
|
|
|
|
public function fileMarhunMain() {
|
|
return $this->hasOne(FileMarhun::class, 'lelongbidmarhun_id');
|
|
}
|
|
|
|
public function lelong()
|
|
{
|
|
return $this->belongsTo(Lelong::class, 'lelong_id', 'id');
|
|
}
|
|
|
|
public function lelongBidMarhun()
|
|
{
|
|
return $this->hasMany(LelongBidMarhun::class, 'lelongbid_id', 'id');
|
|
}
|
|
|
|
public function scanSemakSelesai()
|
|
{
|
|
return $this->hasMany(ScanSemak::class, 'lelongbid_id', 'id')->whereNotNull('scan_masuk');
|
|
}
|
|
|
|
public function pengesahan()
|
|
{
|
|
return $this->belongsTo(Pengesahan::class, 'id', 'lelongbid_id');
|
|
}
|
|
}
|