add feature Data Proses Penawaran
This commit is contained in:
24
app/Models/PenawaranDetailTender.php
Normal file
24
app/Models/PenawaranDetailTender.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PenawaranDetailTender extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $table = 'detail_penawaran';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function penawaran(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(PenawaranTender::class, 'penawaran_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany; // andy add
|
||||
|
||||
class PenawaranTender extends Model
|
||||
{
|
||||
@@ -15,4 +16,11 @@ class PenawaranTender extends Model
|
||||
protected $table = 'penawaran';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
// andy add
|
||||
public function penawarandetails(): HasMany
|
||||
{
|
||||
return $this->hasMany(PenawaranDetailTender::class, 'penawaran_id', 'id')->where('status', '=', 1);
|
||||
}
|
||||
// andy add
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user