Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
el3ab-Player
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
el3ab-Player
Commits
31dae71d
Commit
31dae71d
authored
Jun 03, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: daily-reward and shop use array get instead of getOne
Co-Authored-By:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
d7626367
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
daily-reward.php
api/daily-reward.php
+3
-2
shop.php
api/shop.php
+5
-3
No files found.
api/daily-reward.php
View file @
31dae71d
...
...
@@ -18,9 +18,10 @@ $action = $input['action'] ?? 'claim';
$db
=
supabase
(
$token
);
if
(
$action
===
'claim'
)
{
$profile
=
$db
->
getOne
(
'profiles'
,
[
'id'
=>
'eq.'
.
$userId
,
'select'
=>
'coins,last_daily_claim,daily_streak'
]);
$profiles
=
$db
->
get
(
'profiles'
,
[
'id'
=>
'eq.'
.
$userId
,
'select'
=>
'coins,last_daily_claim,daily_streak'
,
'limit'
=>
1
]);
$profile
=
is_array
(
$profiles
)
&&
!
empty
(
$profiles
)
&&
!
isset
(
$profiles
[
'error'
])
?
$profiles
[
0
]
:
null
;
if
(
!
$profile
||
isset
(
$profile
[
'error'
])
)
jsonError
(
'Profile not found'
);
if
(
!
$profile
)
jsonError
(
'Profile not found'
);
$lastClaim
=
$profile
[
'last_daily_claim'
]
??
null
;
$today
=
date
(
'Y-m-d'
);
...
...
api/shop.php
View file @
31dae71d
...
...
@@ -28,10 +28,12 @@ if ($action === 'purchase') {
$cosmeticId
=
$input
[
'cosmetic_id'
]
??
''
;
if
(
!
$cosmeticId
)
jsonError
(
'cosmetic_id required'
);
$item
=
$db
->
getOne
(
'cosmetics'
,
[
'id'
=>
'eq.'
.
$cosmeticId
]);
if
(
!
$item
||
isset
(
$item
[
'error'
]))
jsonError
(
'Item not found'
,
404
);
$items
=
$db
->
get
(
'cosmetics'
,
[
'id'
=>
'eq.'
.
$cosmeticId
,
'limit'
=>
1
]);
$item
=
is_array
(
$items
)
&&
!
empty
(
$items
)
&&
!
isset
(
$items
[
'error'
])
?
$items
[
0
]
:
null
;
if
(
!
$item
)
jsonError
(
'Item not found'
,
404
);
$profile
=
$db
->
getOne
(
'profiles'
,
[
'id'
=>
'eq.'
.
$userId
,
'select'
=>
'coins,gems'
]);
$profiles
=
$db
->
get
(
'profiles'
,
[
'id'
=>
'eq.'
.
$userId
,
'select'
=>
'coins,gems'
,
'limit'
=>
1
]);
$profile
=
is_array
(
$profiles
)
&&
!
empty
(
$profiles
)
?
$profiles
[
0
]
:
[
'coins'
=>
0
,
'gems'
=>
0
];
$coins
=
$profile
[
'coins'
]
??
0
;
$gems
=
$profile
[
'gems'
]
??
0
;
$priceCoin
=
$item
[
'price_coins'
]
??
0
;
...
...
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