adding function

This commit is contained in:
hafifierahman
2022-04-07 06:25:36 +08:00
parent 9f87040211
commit 7cea54ffd1
4 changed files with 49 additions and 19 deletions
@@ -2210,6 +2210,7 @@ class AdminPageController extends Controller
$pengesahan = Pengesahan::where([['mohonid',$request->mohonid],['tagcit',0]])
->update(array(
'tagcit' => 1,
'resit_cit' => $request->resitcit,
'bank_cit' => $request->bank
));
+44 -16
View File
@@ -643,24 +643,38 @@ class LelongController extends Controller
}
}
public function getSenaraiLelongAktif($kodcaw){
public function getSenaraiLelongAktif($kodcaw,$fasa){
$current = Carbon::now();
$current = new Carbon();
$cawangan = Cawangan::on('mysql7')->where('kodcaw',$kodcaw)->first();
$lelong = Lelong::on($cawangan['mysql'])
->selectRaw('count(*) as total, batchno,t_lelong')
->where('t_lelong','>=',$current->toDateString())
->whereNull('t_jual')
->orderBy('t_lelong','desc')
->groupBy('batchno')
->get();
if($fasa == 'fasa1')
{
$lelong = Lelong::on($cawangan['mysql'])
->selectRaw('count(*) as total, batchno,t_lelong')
->where('t_lelong','>=',$current->toDateString())
->where('fasa', 0)
->whereNull('t_jual')
->orderBy('t_lelong','desc')
->groupBy('batchno')
->get();
}else{
$lelong = Lelong::on($cawangan['mysql'])
->selectRaw('count(*) as total, batchno,t_lelong')
->where('t_lelong','>=',$current->toDateString())
->where('fasa', 1)
->whereNull('t_jual')
->orderBy('t_lelong','desc')
->groupBy('batchno')
->get();
}
return response()->json($lelong);
}
public function getSenaraiBatchNoAktif($kodcaw,Request $request){
public function getSenaraiBatchNoAktif($kodcaw,$fasa,Request $request){
$current = Carbon::now();
$current = new Carbon();
@@ -668,13 +682,27 @@ class LelongController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$lelong = Lelong::on($cawangan['mysql'])
->select('lelong.t_lelong','lelong.norujukan','gadai.jbg','gadai.nokp','gadai.pinjaman','gadai.bakiupah')
->leftJoin('gadai', 'gadai.norujukan', '=', 'lelong.norujukan')
// ->leftJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
->where('batchno','=',$request->batchno)
->orderBy('gadai.t_gadai','asc')
->where('gadai.taglel','=', 1);
if($fasa == 'fasa1')
{
$lelong = Lelong::on($cawangan['mysql'])
->select('lelong.t_lelong','lelong.norujukan','gadai.jbg','gadai.nokp','gadai.pinjaman','gadai.bakiupah')
->leftJoin('gadai', 'gadai.norujukan', '=', 'lelong.norujukan')
// ->leftJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
->where('batchno','=',$request->batchno)
->where('fasa',0)
->orderBy('gadai.t_gadai','asc')
->where('gadai.taglel','=', 1);
}else{
$lelong = Lelong::on($cawangan['mysql'])
->select('lelong.t_lelong','lelong.norujukan','gadai.jbg','gadai.nokp','gadai.pinjaman','gadai.bakiupah')
->leftJoin('gadai', 'gadai.norujukan', '=', 'lelong.norujukan')
// ->leftJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
->where('batchno','=',$request->batchno)
->where('fasa',1)
->orderBy('gadai.t_gadai','asc')
->where('gadai.taglel','=', 1);
}
$batchlel = BatchLel::on($cawangan['mysql'])
->where('batchno','=',$request->batchno)