fix skit2
This commit is contained in:
@@ -1851,7 +1851,13 @@ class AdminPageController extends Controller
|
||||
|
||||
public function GetPermohonanCawangan($kodcaw,Request $request)
|
||||
{
|
||||
$listpermohonan = Permohonan::where('kodcaw', $kodcaw)->get();
|
||||
|
||||
if($kodcaw === 'admin')
|
||||
{
|
||||
$listpermohonan = Permohonan::where('tagterima',0)->orderBy('tarikh_permohonan','desc')->paginate(5);
|
||||
}else{
|
||||
$listpermohonan = Permohonan::where([['kodcaw', $kodcaw],['tagterima',0]])->get();
|
||||
}
|
||||
|
||||
return response()->json($listpermohonan);
|
||||
}
|
||||
@@ -1862,8 +1868,27 @@ class AdminPageController extends Controller
|
||||
$listpermohonan = Permohonan::where([['kodcaw', $kodcaw],['mohonid',$mohonid]])->first()->toArray();
|
||||
$status = Status::where('mohonid',$mohonid)->get()->toArray();
|
||||
|
||||
$permohonanstatus = $listpermohonan + $status;
|
||||
array_push($listpermohonan,(["status" => $status]));
|
||||
|
||||
return response()->json($permohonanstatus);
|
||||
return response()->json($listpermohonan);
|
||||
}
|
||||
|
||||
public function GetDescriptionStatus($mohonid)
|
||||
{
|
||||
$statusarray = [];
|
||||
|
||||
$status = Status::where('mohonid',$mohonid)->get()->toArray();
|
||||
|
||||
foreach($status as $index=>$stat)
|
||||
{
|
||||
$status_lookup = LookupStatus::where('statusid',$stat['statusid'])->first()->toArray();
|
||||
// $status_lookup = $stat['tarikhmasa'];
|
||||
$date = date('d-m-Y',strtotime($stat['tarikhmasa']));
|
||||
$time = date('g:i a',strtotime($stat['tarikhmasa']));
|
||||
array_push($status_lookup,['tarikh' => $date, 'masa' => $time]);
|
||||
array_push($statusarray,$status_lookup);
|
||||
}
|
||||
|
||||
return response()->json($statusarray);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user