sag kb 1
This commit is contained in:
@@ -29,10 +29,21 @@ class MarhunController extends Controller
|
||||
array_push($marhun_all,$marhun);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return response()->json($marhun_all);
|
||||
}
|
||||
|
||||
public function getMutuMarhun(Request $request){
|
||||
$norujukan = $request->norujukan;
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw',$request->kodcaw)->first();
|
||||
|
||||
$marhun = Marhun::on($cawangan['mysql'])->where('norujukan',$request->norujukan)->distinct()->pluck('karat')->toArray();
|
||||
|
||||
$mutu = HargaEmas::on('mysql7')->whereIn('karat',$marhun)->pluck('keterangan')->toArray();
|
||||
|
||||
return response()->json($mutu);
|
||||
}
|
||||
|
||||
public function getMarhunName (Request $request){
|
||||
$jemas = Jemas::on('mysql7')->where('marhun','=',$request->marhun)->first();
|
||||
|
||||
@@ -144,7 +155,7 @@ class MarhunController extends Controller
|
||||
]);
|
||||
|
||||
$new_data = Marhun::on($cawangan['mysql'])->where([['recno','=',$request->recno],['norujukan','=',$norujukan]])->first();
|
||||
|
||||
|
||||
$audit = new Audit();
|
||||
$audit->users = $request->teller;
|
||||
$audit->actions = 'Ubah Marhun';
|
||||
@@ -165,11 +176,11 @@ class MarhunController extends Controller
|
||||
$marhun = Marhun::on($cawangan['mysql'])
|
||||
->select('marhun.norujukan','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||
->rightJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
|
||||
->rightJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
|
||||
->where('marhun.t_gadai','=',$tarikh)
|
||||
->orderBy('marhun.t_gadai')
|
||||
->get();
|
||||
|
||||
|
||||
return response()->json($marhun);
|
||||
}
|
||||
|
||||
@@ -177,19 +188,19 @@ class MarhunController extends Controller
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$marhun = Marhun::on($cawangan['mysql'])
|
||||
->select('marhun.norujukan','gadai.sttebus','gadai.pinjaman','gadai.nokp','customer.nama','marhun.marhun','marhun.nota','marhun.berat','marhun.karat','marhun.harga','marhun.n_marhun','marhun.t_gadai')
|
||||
->rightJoin('gadai', 'gadai.norujukan', '=', 'marhun.norujukan')
|
||||
->rightJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
|
||||
->rightJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
|
||||
->where('marhun.t_gadai','<=',$tarikh)
|
||||
->whereYear('marhun.t_gadai','=',$current->year)
|
||||
->where('gadai.sttebus','=','')
|
||||
->orderBy('marhun.norujukan')
|
||||
->get();
|
||||
|
||||
|
||||
return response()->json($marhun);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user