Perbaikan minor
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Http\Setup\Gate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\NamaPos;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MasterGateController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$Gate = NamaPos::all();
|
||||
return view ('setup.gate.gate', compact('Gate'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Http\Setup\Gate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ConfigHardware;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class MasterGateHardwareController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
Log::info($id);
|
||||
$gateDetails = ConfigHardware::where('id_pos', $id)->first();
|
||||
return $gateDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
Log::info($id);
|
||||
Log::info($request->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Http\Setup\Gate;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MasterGateParameterController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,12 @@ public function dataStiker(Request $request)
|
||||
->leftJoin('stasiunkerja as b', 'a.unit_kerja', '=', 'b.kode')
|
||||
->leftJoin('jenis_langganan as c', 'a.jenis_langganan', '=', 'c.id')
|
||||
->leftJoin('pegawai as p', 'a.operator', '=', 'p.nomer')
|
||||
->select('a.*', 'c.nama as jenis_langganan','b.nama as stasiunkerja','p.nama as petugas')
|
||||
// ->leftJoin('tarif_stiker as ts','ts.id_mobil','=','a.jenis_mobil')
|
||||
->leftJoin('tarif_stiker as ts', function ($join) {
|
||||
$join->on('ts.id_mobil', '=', 'a.jenis_mobil')
|
||||
->on('ts.jenis_langganan', '=', 'a.jenis_member');
|
||||
})
|
||||
->select('a.*', 'c.nama as jenis_langganan','b.nama as stasiunkerja','p.nama as petugas','ts.tarif')
|
||||
->whereBetween('a.tgl_edited', [
|
||||
$validated['tanggalAwal'] . ' 00:00:00',
|
||||
$validated['tanggalAkhir'] . ' 23:59:59'
|
||||
|
||||
@@ -52,10 +52,18 @@ public function store(Request $request, MakeStikerServices $makeStiker)
|
||||
'tanggal_selesai' => 'required|date|after:tanggal_mulai',
|
||||
]);
|
||||
|
||||
$blnKemarin = Carbon::now()->subMonth()->format('Y-m');
|
||||
$start = Carbon::now()->subMonth()->startOfMonth();
|
||||
$end = Carbon::now()->subMonth()->endOfMonth();
|
||||
$tanggalMulai = Carbon::parse($request->tanggal_mulai);
|
||||
$tanggalSelesai = Carbon::parse($request->tanggal_selesai);
|
||||
$sticker = TransaksiStiker::select('notrans')->whereIn('jenis_langganan', $request->jenis_langganan)->get();
|
||||
$sticker = TransaksiStiker::select('notrans')
|
||||
->whereIn('jenis_langganan', $request->jenis_langganan)
|
||||
// ->whereRaw("to_char(tgl_edited, 'YYYY-MM') = ?", [$blnKemarin])
|
||||
->whereBetween('tgl_edited', [$start, $end])
|
||||
->get();
|
||||
// $sticker = DB::table('mergetransaksistikerdetail')->whereIn('jenis_langganan', $request->jenis_langganan)->get();
|
||||
$jumlah = $sticker->count();
|
||||
foreach ($sticker as $row) {
|
||||
// $makeStiker->stikerExtend($sticker);
|
||||
$makeStiker->stikerExtend(
|
||||
@@ -67,7 +75,8 @@ public function store(Request $request, MakeStikerServices $makeStiker)
|
||||
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'message' => 'Stiker berhasil diproses'
|
||||
'message' => 'Stiker berhasil diproses',
|
||||
'jumlah' => $jumlah,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -79,10 +88,20 @@ public function store(Request $request, MakeStikerServices $makeStiker)
|
||||
*/
|
||||
public function show($id, Request $request)
|
||||
{
|
||||
Log::info($request->pilihannya);
|
||||
$selected = $request->pilihannya;
|
||||
Log::info($id);
|
||||
$start = Carbon::now()->subMonth()->startOfMonth();
|
||||
$end = Carbon::now()->subMonth()->endOfMonth();
|
||||
Log::info($start);
|
||||
Log::info($end);
|
||||
|
||||
$blnKemarin = Carbon::now()->subMonth()->format('Y-m');
|
||||
Log::info($blnKemarin);
|
||||
// $selected = $request->pilihannya;
|
||||
$selected = $id;
|
||||
$count = DB::table('transaksi_stiker')
|
||||
->whereIn('jenis_langganan', $selected)
|
||||
->where('jenis_langganan', $selected)
|
||||
// ->whereRaw("to_char(tgl_edited, 'YYYY-MM') = ?", [$blnKemarin])
|
||||
->whereBetween('tgl_edited', [$start, $end])
|
||||
->get();
|
||||
|
||||
$jumlah = $count->count();
|
||||
|
||||
Reference in New Issue
Block a user