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('t_jual','<=',$request->tarikh)
|
||||||
->where(function($query) use ($tarikhbaru){
|
->where(function($query) use ($tarikhbaru){
|
||||||
$query->whereNull('trkhtuntut')
|
$query->whereNull('trkhtuntut')
|
||||||
->orWhere('trkhtuntut','>','2021-02-25');
|
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||||
})
|
})
|
||||||
->where('baki','>=',0)
|
->where('baki','>=',0)
|
||||||
->sum('baki');
|
->sum('baki');
|
||||||
@@ -236,57 +236,19 @@ class LelongController extends Controller
|
|||||||
$tarikhbaru = $request->mula;
|
$tarikhbaru = $request->mula;
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$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'])
|
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||||
->sum('bayaran');
|
->where('trkhtuntut','>=',$request->mula)
|
||||||
|
->where('trkhtuntut','<=',$request->hingga)
|
||||||
|
->where('baki','>=',0)
|
||||||
|
->sum('baki');
|
||||||
|
|
||||||
$rugilelong = Lelong::on($cawangan['mysql'])
|
$rugilelong = Lelong::on($cawangan['mysql'])
|
||||||
->where('trkhtuntut','>=',$request->mula)
|
->where('trkhtuntut','>=',$request->mula)
|
||||||
->where('trkhtuntut','<=',$request->hingga)
|
->where('trkhtuntut','<=',$request->hingga)
|
||||||
//->where(function($query) use ($tarikhbaru)
|
|
||||||
//{
|
|
||||||
// $query->whereNull('t_jual')
|
|
||||||
// ->orWhere('t_jual','>',$tarikhbaru);
|
|
||||||
//})
|
|
||||||
->where('baki','<',0)
|
->where('baki','<',0)
|
||||||
->sum('baki');
|
->sum('baki');
|
||||||
|
|
||||||
// $rugitotal = $rugilelong + $ansrugi;
|
|
||||||
$rugitotal = $rugilelong;
|
$rugitotal = $rugilelong;
|
||||||
|
|
||||||
$arraylelong = ['bakilelong' => $bakilelong, 'rugilelong' => $rugitotal];
|
$arraylelong = ['bakilelong' => $bakilelong, 'rugilelong' => $rugitotal];
|
||||||
|
|||||||
@@ -165,6 +165,8 @@ class TebusController extends Controller
|
|||||||
|
|
||||||
public function getMoratorium(){
|
public function getMoratorium(){
|
||||||
$bln_mora = Moratorium::first();
|
$bln_mora = Moratorium::first();
|
||||||
|
|
||||||
|
return response()->json($bln_mora);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateMoratorium(Request $request){
|
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/laporan/{kodcaw}/{tarikh}',['uses'=>'TebusController@getLaporanTebus']);
|
||||||
$router->get('tebus/laporanjenistawarruq/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasingan']);
|
$router->get('tebus/laporanjenistawarruq/{kodcaw}',['uses'=>'TebusController@getLaporanTebusPengasingan']);
|
||||||
|
|
||||||
|
$router->get('moratorium/details',['uses'=>'TebusController@getMoratorium']);
|
||||||
|
|
||||||
//Maintenance API TEBUS
|
//Maintenance API TEBUS
|
||||||
// $router->get('rebet/{kodcaw}/{norujukan}',['uses' => 'TebusController@rebet']);
|
// $router->get('rebet/{kodcaw}/{norujukan}',['uses' => 'TebusController@rebet']);
|
||||||
$router->put('updatetebus/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusUpdate']);
|
$router->put('updatetebus/{kodcaw}/{norujukan}',['uses'=>'TebusController@tebusUpdate']);
|
||||||
|
|||||||
Reference in New Issue
Block a user