Merge branch 'apiaku' into 'master'
fix skit2 pasal lelong See merge request online-sistem1/api_arrahn!64
This commit is contained in:
@@ -54,8 +54,8 @@ class LelongController extends Controller
|
||||
{
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$bakilelong = Gadai::on($cawangan['mysql'])
|
||||
->where([['sttebus','=', 'L'],['nokp','=',$noic],['baki','not like', '-%']])
|
||||
->whereNull('trkhtuntut')
|
||||
->where([['gadai.sttebus','=', 'L'],['gadai.nokp','=',$noic],['lelong.baki','not like', '-%']])
|
||||
->whereNull('lelong.trkhtuntut')
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->sum('baki');
|
||||
|
||||
@@ -72,8 +72,8 @@ class LelongController extends Controller
|
||||
{
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$rugilelong = Gadai::on($cawangan['mysql'])
|
||||
->where([['sttebus','=', 'L'],['nokp','=',$noic],['baki','like', '-%']])
|
||||
->whereNull('trkhtuntut')
|
||||
->where([['gadai.sttebus','=', 'L'],['gadai.nokp','=',$noic],['lelong.baki','like', '-%']])
|
||||
->whereNull('lelong.trkhtuntut')
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->sum('baki');
|
||||
|
||||
@@ -87,6 +87,49 @@ class LelongController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function showBakiLelongEachCawangan($kodcaw,$noic,$jenislelong)
|
||||
{
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$bakilelongtotal = 0;
|
||||
$rugilelongtotal = 0;
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
if($jenislelong == 'baki')
|
||||
{
|
||||
$bakilelong = Gadai::on($cawangan['mysql'])
|
||||
->where([['gadai.sttebus','=', 'L'],['gadai.nokp','=',$noic],['lelong.baki','not like', '-%']])
|
||||
->whereNull('lelong.trkhtuntut')
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->sum('baki');
|
||||
|
||||
if($bakilelong != 0){
|
||||
$bakilelongtotal += $bakilelong;
|
||||
}
|
||||
|
||||
|
||||
return response()->json($bakilelongtotal, 200);
|
||||
|
||||
}
|
||||
|
||||
else if($jenislelong == 'rugi')
|
||||
{
|
||||
$rugilelong = Gadai::on($cawangan['mysql'])
|
||||
->where([['gadai.sttebus','=', 'L'],['gadai.nokp','=',$noic],['lelong.baki','like', '-%']])
|
||||
->whereNull('lelong.trkhtuntut')
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->sum('baki');
|
||||
|
||||
if($rugilelong != 0){
|
||||
$rugilelongtotal += $rugilelong;
|
||||
}
|
||||
|
||||
|
||||
return response()->json($rugilelongtotal, 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function BilAkanDilelong($noic)
|
||||
{
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
|
||||
@@ -102,6 +102,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->delete('lelong/{id}', ['uses' => 'LelongController@delete']);
|
||||
$router->put('lelong/{id}', ['uses' => 'LelongController@update']);
|
||||
$router->get('bakilelong/{noic}/{jenislelong}',['uses'=>'LelongController@showBakiLelong']);
|
||||
$router->get('bakilelong/cawangan/{kodcaw}/{noic}/{jenislelong}',['uses'=>'LelongController@showBakiLelongEachCawangan']);
|
||||
$router->get('bilangandilelong/{noic}',['uses'=>'LelongController@BilAkanDilelong']);
|
||||
$router->get('lelong/laporan/{kodcaw}/{tarikh}',['uses'=>'GadaiController@getLaporanLelong']); //laporan lelong
|
||||
|
||||
|
||||
Reference in New Issue
Block a user