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
don
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
LQDN Adminsys
don
Commits
44849044
Commit
44849044
authored
Dec 13, 2018
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AUTO_INCREMENT returns the ID of the Next attribute, not the Last one
parent
fc3dabe7
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
5 deletions
+9
-5
app/controller/admin.php
app/controller/admin.php
+1
-1
app/controller/perso.php
app/controller/perso.php
+1
-1
app/view/backend/contreparties.html
app/view/backend/contreparties.html
+3
-1
app/view/backend/user.html
app/view/backend/user.html
+2
-0
src/LQDN/Finder/CounterpartFinder.php
src/LQDN/Finder/CounterpartFinder.php
+2
-2
No files found.
app/controller/admin.php
View file @
44849044
...
...
@@ -440,7 +440,7 @@ class Admin extends Controller
if
(
$user
[
'cumul'
]
>=
$needed
)
{
// Assez de point, on crée
// On récupère le dernier ID inséré
$parent
=
$f3
->
get
(
'container'
)[
'counterpart_finder'
]
->
get
LastInsertedId
()
+
1
;
$parent
=
$f3
->
get
(
'container'
)[
'counterpart_finder'
]
->
get
NextInsertedId
()
;
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
CounterpartCreateCommand
(
$adresse
[
'id'
],
$user
[
'id'
],
$quoi
,
1
,
2
,
date
(
"Y-m-d H:i:s"
),
'Imported from a file'
,
$parent
));
// On mets à jour le cumul de l'utilisateur
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
UserUpdateCumulCommand
(
$user
[
'id'
],
$user
[
'cumul'
]
-
$needed
));
...
...
app/controller/perso.php
View file @
44849044
...
...
@@ -337,7 +337,7 @@ class Perso extends Controller
// Ajout d'une demande de contrepartie pour chaque contrepartie
if
((
int
)
$user
[
'cumul'
]
>=
$valeur
)
{
$parent
=
$f3
->
get
(
'container'
)[
'counterpart_finder'
]
->
get
LastInsertedId
()
+
1
;
$parent
=
$f3
->
get
(
'container'
)[
'counterpart_finder'
]
->
get
NextInsertedId
()
;
switch
(
$quoi
)
{
case
'hoodie'
:
$f3
->
get
(
'container'
)[
'command_handler'
]
->
handle
(
new
CounterpartCreateCommand
(
\
Utils
::
asl
(
$adresse_id
),
$f3
->
get
(
'SESSION.id'
),
'hoodie'
,
\
Utils
::
asl
(
$taille_h
),
1
,
date
(
"Y-m-d H:i:s"
),
\
Utils
::
asl
(
$commentaire
),
$parent
));
...
...
app/view/backend/contreparties.html
View file @
44849044
...
...
@@ -43,6 +43,7 @@
<table
cellspacing=
"0"
cellpadding=
"0"
>
<theader>
<th>
Id
</th>
<th>
Id du parent
</th>
<th>
Email
</th>
<th>
Date
</th>
<th>
Quoi
</th>
...
...
@@ -56,7 +57,8 @@
<repeat
group=
"{{ @data }}"
value=
"{{ @row }}"
>
<tr>
<td>
{{ @row.id }}
</td>
<td><a
href=
"{{'user_info', 'id='.@row.user_id | alias }}"
>
{{ @row.email }}
</a></td>
<td>
{{ @row.parent }}
</td>
<td><a
href=
"{{'user_info', 'id='.@row.user_id | alias }}"
>
{{ @row.email }}
</a></td>
<td>
{{ @row.datec }}
</td>
<td>
{{ @row.quoi }}
</td>
<td>
...
...
app/view/backend/user.html
View file @
44849044
...
...
@@ -95,6 +95,7 @@
<table
cellspacing=
"0"
cellpadding=
"0"
>
<theader>
<th>
Id
</th>
<th>
Id du parent
</th>
<th>
Date
</th>
<th>
Quoi
</th>
<th>
Taille/Piplome
</th>
...
...
@@ -106,6 +107,7 @@
<repeat
group=
"{{ @user.contreparties }}"
value=
"{{ @row }}"
>
<tr>
<td>
{{ @row.id }}
</td>
<td>
{{ @row.parent }}
</td>
<td>
{{ @row.datec }}
</td>
<td>
{{ @row.quoi }}
</td>
<td>
...
...
src/LQDN/Finder/CounterpartFinder.php
View file @
44849044
...
...
@@ -58,11 +58,11 @@ EOQ;
}
/**
* return the
last inserted i
d
* return the
id of the next item to be inserte
d
*
* @return int
*/
public
function
get
Las
tInsertedId
()
public
function
get
Nex
tInsertedId
()
{
return
(
int
)
$this
->
connection
->
fetchColumn
(
"SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name = 'contreparties' AND table_schema = DATABASE()"
...
...
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