Merged in hotfix/fix-masa-tebus (pull request #230)
fix masa di laporan tebus(arrange)
This commit is contained in:
@@ -249,14 +249,33 @@ class TebusController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tebus_data = Tebus::on($cawangan['mysql'])
|
||||
->select('tebus.t_tebus', 'gad.t_gadai','gad.hargajualan','gad.bakihargajualan','gad.bakipjm as gadaibakipjm','tebus.nilaimarhun','tebus.tagterima', 'tebus.teller','tebus.jenistebus','tebus.pinjaman','tebus.bakiupah','tebus.bakipjm','gad.norujukan','gad.nokp','tebus.jbg','tebus.ujrah','tebus.onepercent','gad.tagbaru')
|
||||
->join('gadai as gad','gad.norujukan','=','tebus.norujukan')
|
||||
->where('tebus.t_tebus','>=',$request->mula)
|
||||
->where('tebus.t_tebus','<=',$request->akhir)
|
||||
->groupBy('tebus.norujukan')
|
||||
->orderBy('tebus.teller')
|
||||
->orderBy('tebus.sirit')
|
||||
->get();
|
||||
->select(
|
||||
'tebus.t_tebus',
|
||||
'gad.t_gadai',
|
||||
'gad.hargajualan',
|
||||
'gad.bakihargajualan',
|
||||
'gad.bakipjm as gadaibakipjm',
|
||||
'tebus.nilaimarhun',
|
||||
'tebus.tagterima',
|
||||
'tebus.teller',
|
||||
'tebus.jenistebus',
|
||||
'tebus.pinjaman',
|
||||
'tebus.bakiupah',
|
||||
'tebus.bakipjm',
|
||||
'gad.norujukan',
|
||||
'gad.nokp',
|
||||
'tebus.jbg',
|
||||
'tebus.ujrah',
|
||||
'tebus.onepercent',
|
||||
'gad.tagbaru'
|
||||
)
|
||||
->join('gadai as gad', 'gad.norujukan', '=', 'tebus.norujukan')
|
||||
->where('tebus.t_tebus', '>=', $request->mula)
|
||||
->where('tebus.t_tebus', '<=', $request->akhir)
|
||||
->groupBy('tebus.norujukan')
|
||||
->orderBy('tebus.teller')
|
||||
->orderBy('tebus.sirit')
|
||||
->get();
|
||||
|
||||
$tebus = [];
|
||||
if($tebus_data){
|
||||
@@ -294,7 +313,13 @@ class TebusController extends Controller
|
||||
$compare_teller = strcmp($a['teller'], $b['teller']);
|
||||
|
||||
if ($compare_teller === 0) {
|
||||
return strcmp($a['t_tebus'], $b['t_tebus']);
|
||||
$compare_tebus = strcmp($a['t_tebus'], $b['t_tebus']);
|
||||
|
||||
if ($compare_tebus === 0) {
|
||||
return $a['tarikh_bayaran'] <=> $b['tarikh_bayaran'];
|
||||
}
|
||||
|
||||
return $compare_tebus;
|
||||
}
|
||||
|
||||
return $compare_teller;
|
||||
|
||||
Reference in New Issue
Block a user