This commit is contained in:
Azfar Arsyad
2021-12-28 17:02:12 +08:00
parent 6b53072fee
commit 7e7bcc5521
5 changed files with 16 additions and 2 deletions
+11
View File
@@ -227,6 +227,7 @@ class LelongController extends Controller
$cawangansim = CawanganSimulasi::where('simulasi_id','=',$id)->get();
$simkarat = SimKarat::where('simulasi_id','=',$id)->get();
$lelong = new Lelong();
$lelong->tarikh_lelong = $simulasi->tarikh_lelong;
$lelong->harga_emas_asas = $simulasi->harga_emas_asas;
@@ -247,7 +248,17 @@ class LelongController extends Controller
foreach($cawangansim as $caw)
{
$cawanganlel = CawanganLelong::where('caw_id','=',$caw->caw_id)->orderBy('id','desc')->first();
if($cawanganlel)
{
$batchno = $cawanganlel->batchlel+1;
}
else
{
$batchno = 1;
}
$caw_lelong = new CawanganLelong;
$caw_lelong->batchlel = $batchno;
$caw_lelong->lelong_id = $lelong->id;
$caw_lelong->caw_id = $caw->caw_id;
$caw_lelong->online = $caw->online;
+2 -1
View File
@@ -185,6 +185,7 @@ class SimulasiController extends Controller
}
elseif($request->caw && $request->caw != 'all')
{
$caw = $cawangan->where('id','=',$request->caw)->first();
$caw_simulasi = new CawanganSimulasi;
$caw_simulasi->simulasi_id = $simulasi->id;
$caw_simulasi->caw_id = $request->caw;
@@ -192,7 +193,7 @@ class SimulasiController extends Controller
$caw_simulasi->lokasi = $caw->lokasi;
$caw_simulasi->save();
$suratcaw = $surat->where('kodcaw','=',$caw->code)->get();
$suratcaw = $surat->where('kodcaw','=',$caw->caw_code)->all();
// $simulasibid = SimulasiBid::where('caw_id','=',$caw->id)->get();
foreach($suratcaw as $data)
{
+1
View File
@@ -12,6 +12,7 @@ class CawanganLelong extends Model
protected $table = 'cawangan_lelong';
protected $fillable = [
'batchlel',
'lelong_id',
'caw_id',
'online',
@@ -28,6 +28,7 @@ class CreateLelongsTable extends Migration
Schema::create('cawangan_lelong', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('batchlel')->nullable();
$table->unsignedBigInteger('lelong_id')->unsigned();
$table->unsignedBigInteger('caw_id')->unsigned();
$table->string('online');
+1 -1
View File
@@ -138,7 +138,7 @@ class RolesSeeder extends Seeder
$role5->givePermissionTo('janapemenang');
$role6 = Role::create(['name' => 'operasi']);
$role5->givePermissionTo('pendaftaranbatch');
$role6->givePermissionTo('pendaftaranbatch');
$role6->givePermissionTo('report');
$role6->givePermissionTo('tangguhan');
$role6->givePermissionTo('analisa');