add lapora barang kes
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Audit;
|
||||||
|
use App\Polis;
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\LookupAlasan;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class BarangkesController extends Controller
|
||||||
|
{
|
||||||
|
public function LaporanBarangKes(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw', $request->kodcaw)->first();
|
||||||
|
|
||||||
|
if (!$cawangan) {
|
||||||
|
return response()->json(['error' => 'Invalid kodcaw'], 403);
|
||||||
|
}
|
||||||
|
|
||||||
|
$query = DB::connection($cawangan['mysql'])->table('palsu')
|
||||||
|
->select([
|
||||||
|
'tarikh',
|
||||||
|
'norujukan',
|
||||||
|
'nota',
|
||||||
|
'pembiayaan',
|
||||||
|
'nilaimarhun',
|
||||||
|
'jbg',
|
||||||
|
'untung',
|
||||||
|
'untungonepercent',
|
||||||
|
'untungcajlain'
|
||||||
|
])
|
||||||
|
->whereBetween('tarikh', [$request->tarikh_mula, $request->tarikh_akhir]);
|
||||||
|
|
||||||
|
$result = $query->get();
|
||||||
|
|
||||||
|
return response()->json($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -452,6 +452,13 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->get('laporan/lelong',['uses' => 'LelongController@LaporanLelong']);
|
$router->get('laporan/lelong',['uses' => 'LelongController@LaporanLelong']);
|
||||||
$router->get('lookupbatchlel/{kodcaw}',['uses' => 'LelongController@LookupBatchLel']);
|
$router->get('lookupbatchlel/{kodcaw}',['uses' => 'LelongController@LookupBatchLel']);
|
||||||
|
|
||||||
|
// $router->post('admin/BarangKes', ['uses' => 'BarangKesController@laporanBarangKes']);
|
||||||
|
// $router->get('barangkes/laporan', ['uses' => 'BarangKesController@LaporanBarangKes']);
|
||||||
|
$router->get('palsu/laporan', ['uses' => 'BarangkesController@LaporanBarangKes']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user