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]]) $pengesahan = Pengesahan::where([['mohonid',$request->mohonid],['tagcit',0]])
->update(array( ->update(array(
'tagcit' => 1, 'tagcit' => 1,
'resit_cit' => $request->resitcit,
'bank_cit' => $request->bank '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 = Carbon::now();
$current = new Carbon(); $current = new Carbon();
$cawangan = Cawangan::on('mysql7')->where('kodcaw',$kodcaw)->first(); $cawangan = Cawangan::on('mysql7')->where('kodcaw',$kodcaw)->first();
$lelong = Lelong::on($cawangan['mysql']) if($fasa == 'fasa1')
->selectRaw('count(*) as total, batchno,t_lelong') {
->where('t_lelong','>=',$current->toDateString()) $lelong = Lelong::on($cawangan['mysql'])
->whereNull('t_jual') ->selectRaw('count(*) as total, batchno,t_lelong')
->orderBy('t_lelong','desc') ->where('t_lelong','>=',$current->toDateString())
->groupBy('batchno') ->where('fasa', 0)
->get(); ->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); return response()->json($lelong);
} }
public function getSenaraiBatchNoAktif($kodcaw,Request $request){ public function getSenaraiBatchNoAktif($kodcaw,$fasa,Request $request){
$current = Carbon::now(); $current = Carbon::now();
$current = new Carbon(); $current = new Carbon();
@@ -668,13 +682,27 @@ class LelongController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first(); $cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$lelong = Lelong::on($cawangan['mysql']) if($fasa == 'fasa1')
->select('lelong.t_lelong','lelong.norujukan','gadai.jbg','gadai.nokp','gadai.pinjaman','gadai.bakiupah') {
->leftJoin('gadai', 'gadai.norujukan', '=', 'lelong.norujukan') $lelong = Lelong::on($cawangan['mysql'])
// ->leftJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp') ->select('lelong.t_lelong','lelong.norujukan','gadai.jbg','gadai.nokp','gadai.pinjaman','gadai.bakiupah')
->where('batchno','=',$request->batchno) ->leftJoin('gadai', 'gadai.norujukan', '=', 'lelong.norujukan')
->orderBy('gadai.t_gadai','asc') // ->leftJoin('customer', 'customer.kpbaru', '=', 'gadai.nokp')
->where('gadai.taglel','=', 1); ->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']) $batchlel = BatchLel::on($cawangan['mysql'])
->where('batchno','=',$request->batchno) ->where('batchno','=',$request->batchno)
+2 -1
View File
@@ -37,7 +37,8 @@ class Pengesahan extends Model
'tagcit', 'tagcit',
'bank_cit', 'bank_cit',
'komen_batal', 'komen_batal',
'kelulusanpbimage' 'kelulusanpbimage',
'resit_cit'
]; ];
/** /**
+2 -2
View File
@@ -262,8 +262,8 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('gadai/JumlahagingBulanan/test/{kodcaw}/{tarikh}',['uses'=>'GadaiController@carian_Seluruh_AgingBulanan']); $router->get('gadai/JumlahagingBulanan/test/{kodcaw}/{tarikh}',['uses'=>'GadaiController@carian_Seluruh_AgingBulanan']);
//LELONG API //LELONG API
$router->get('senaraibatch/aktif/{kodcaw}',['uses'=>'LelongController@getSenaraiLelongAktif']); $router->get('senaraibatch/aktif/{kodcaw}/{fasa}',['uses'=>'LelongController@getSenaraiLelongAktif']);
$router->get('senaraibatch/laporan/{kodcaw}',['uses'=>'LelongController@getSenaraiBatchNoAktif']); $router->get('senaraibatch/laporan/{kodcaw}/{fasa}',['uses'=>'LelongController@getSenaraiBatchNoAktif']);
$router->get('details/notislelong/{kodcaw}',['uses'=>'LelongController@DetailsNotisLelong']); $router->get('details/notislelong/{kodcaw}',['uses'=>'LelongController@DetailsNotisLelong']);