This commit is contained in:
Pusdatin BPKD Jkt
2022-07-11 16:26:39 +07:00
parent b2c962f2b5
commit a4de789b93
22 changed files with 731 additions and 236 deletions
@@ -4,7 +4,9 @@ namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\SubKegiatan;
use App\Models\Sps_pendapatan;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class ItemSearchController extends Controller
{
@@ -44,4 +46,18 @@ class ItemSearchController extends Controller
}
return response()->json($tropd);
}
public function sps(Request $request)
{
$tropd = [];
if($request->has('q')){
$search = strtolower($request->q);
$ta = $request->ta;
$select = DB::raw("ID,KODE_REKENING||' | '||NAMA_REKENING as name");
$tropd = Sps_pendapatan::select($select)
->whereRaw("TAHUN=$ta AND SKPD_ID = 980 AND (LOWER(KODE_REKENING) LIKE '%$search%' OR LOWER(NAMA_REKENING) LIKE '%$search%')")
->get();
}
return response()->json($tropd);
}
}