Merge branch 'master' of https://gitlab.com/online-sistem1/api_arrahn
This commit is contained in:
@@ -171,7 +171,7 @@ class LelongController extends Controller
|
||||
->where('t_jual','<=',$request->tarikh)
|
||||
->where(function($query) use ($tarikhbaru){
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>','2021-02-25');
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
@@ -236,57 +236,19 @@ class LelongController extends Controller
|
||||
$tarikhbaru = $request->mula;
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
if($kodcaw == 'KB2')
|
||||
{
|
||||
if($request->tarikh <= '2021-02-25')
|
||||
{
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','>=',$request->mula)
|
||||
->where('t_jual','<=',$request->hingga)
|
||||
->where(function($query) use ($tarikhbaru){
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
}else{
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','>=',$request->mula)
|
||||
->where('t_jual','<=',$request->hingga)
|
||||
->where(function($query) use ($tarikhbaru){
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>','2021-02-25');
|
||||
})
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
}
|
||||
}else{
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('trkhtuntut','>=',$request->mula)
|
||||
->where('trkhtuntut','<=',$request->hingga)
|
||||
// ->where(function($query) use ($tarikhbaru){
|
||||
// $query->whereNull('trkhtuntut')
|
||||
// ->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
// })
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
}
|
||||
|
||||
$ansrugi = AnsRugi::on($cawangan['mysql'])
|
||||
->sum('bayaran');
|
||||
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('trkhtuntut','>=',$request->mula)
|
||||
->where('trkhtuntut','<=',$request->hingga)
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
|
||||
$rugilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('trkhtuntut','>=',$request->mula)
|
||||
->where('trkhtuntut','<=',$request->hingga)
|
||||
//->where(function($query) use ($tarikhbaru)
|
||||
//{
|
||||
// $query->whereNull('t_jual')
|
||||
// ->orWhere('t_jual','>',$tarikhbaru);
|
||||
//})
|
||||
->where('baki','<',0)
|
||||
->sum('baki');
|
||||
|
||||
// $rugitotal = $rugilelong + $ansrugi;
|
||||
|
||||
$rugitotal = $rugilelong;
|
||||
|
||||
$arraylelong = ['bakilelong' => $bakilelong, 'rugilelong' => $rugitotal];
|
||||
|
||||
@@ -165,6 +165,8 @@ class TebusController extends Controller
|
||||
|
||||
public function getMoratorium(){
|
||||
$bln_mora = Moratorium::first();
|
||||
|
||||
return response()->json($bln_mora);
|
||||
}
|
||||
|
||||
public function updateMoratorium(Request $request){
|
||||
|
||||
@@ -101,6 +101,8 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('tebus/laporan/{kodcaw}/{tarikh}',['uses'=>'TebusController@getLaporanTebus']);
|
||||
$router->get('tebus/laporanjenistawarruq/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasingan']);
|
||||
|
||||
$router->get('moratorium/details',['uses'=>'TebusController@getMoratorium']);
|
||||
|
||||
//Maintenance API TEBUS
|
||||
// $router->get('rebet/{kodcaw}/{norujukan}',['uses' => 'TebusController@rebet']);
|
||||
$router->put('updatetebus/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusUpdate']);
|
||||
|
||||
Reference in New Issue
Block a user