Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Ardy Pranata
elgaday-hr-v2
Commits
922e2fa6
Commit
922e2fa6
authored
5 months ago
by
Achmad Hammam
Browse files
Options
Download
Email Patches
Plain Diff
update
parent
8d62c6a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
app/Http/Controllers/API/GajiController.php
app/Http/Controllers/API/GajiController.php
+13
-7
No files found.
app/Http/Controllers/API/GajiController.php
View file @
922e2fa6
...
...
@@ -16,14 +16,19 @@
class
GajiController
extends
Controller
{
function
download
()
function
download
(
Request
$request
)
{
$validation
=
$request
->
validate
([
'bulan'
=>
'required'
,
'tahun'
=>
'required'
]);
$authUser
=
auth
(
'api'
)
->
user
();
$gaji_pegawai
=
VwGajiPegawai
::
with
([
'bonus_gaji_pegawai'
=>
function
(
$q
)
{
$q
->
orderBy
(
'id'
,
'desc'
);
}
])
->
with
([
$gaji_pegawai
=
VwGajiPegawai
::
where
(
'user_id'
,
'='
,
$authUser
->
id
)
->
with
([
'bonus_gaji_pegawai'
=>
function
(
$q
)
{
$q
->
orderBy
(
'id'
,
'desc'
);
}
])
->
with
([
'potongan_gaji_pegawai'
=>
function
(
$q
)
{
$q
->
orderBy
(
'id'
,
'desc'
);
}
...
...
@@ -33,7 +38,8 @@ function download()
}
])
->
where
([
[
'user_id'
,
'='
,
$authUser
->
id
],
[
'bulan'
,
'='
,
(
str_pad
(
now
()
->
subMonth
()
->
month
,
2
,
'0'
,
STR_PAD_LEFT
))]
[
'bulan'
,
'='
,
date
(
'm'
,
strtotime
(
$request
->
bulan
))],
[
'tahun'
,
'='
,
$request
->
tahun
]
])
->
first
();
if
(
!
$gaji_pegawai
)
{
return
response
()
->
json
([
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment