server latest

This commit is contained in:
e.arrahn
2021-08-08 01:08:36 +08:00
parent 439f05e46d
commit 4712b6d2d2
4 changed files with 15 additions and 55 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ class LaporanController extends Controller
//b
$bilangan_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->count();
$bilangan_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->where('pinjaman','>',0)->count();
$bilangan_tebus = Tebus::on($cawangan['mysql'])->where('t_tebus','=',$request->tarikh)->count();
$bilangan_ansuran = Transaction::on('mysql7')->whereRaw('DATE(created_at) = ?',[$request->tarikh])->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]])->count();
$bilangan_customer_baru = Customer::on('mysql7')->where([['tarikhdaftar','=',$request->tarikh],['kodcaw',$request->kodcaw]])->count();
@@ -256,7 +256,7 @@ class LaporanController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$laporan_terkumpul = [];
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir]]);
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir]])->where('pinjaman','>',0);
$tebus = Tebus::on($cawangan['mysql'])->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir]]);
$ansuran = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]]);
+13 -13
View File
@@ -249,12 +249,12 @@ class LelongController extends Controller
}
}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','>',$tarikhbaru);
})
->where('trkhtuntut','>=',$request->mula)
->where('trkhtuntut','<=',$request->hingga)
// ->where(function($query) use ($tarikhbaru){
// $query->whereNull('trkhtuntut')
// ->orWhere('trkhtuntut','>',$tarikhbaru);
// })
->where('baki','>=',0)
->sum('baki');
}
@@ -263,13 +263,13 @@ class LelongController extends Controller
->sum('bayaran');
$rugilelong = 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('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');
@@ -195,13 +195,6 @@ class PanjarController extends Controller
->sum('bayaran');
if($kodcaw == 'APM')
{
$perubatan = $perubatan - 10;
$baikidanselenggara = $baikidanselenggara - 10;
}
$arraycalculation = ['bds' => $baikidanselenggara, 'perubatan' => $perubatan, 'keraian' => $keraian];
return response()->json($arraycalculation);