la table membres devient users
FossilOrigin-Name: b3f100b821b0fca9ad9416d202ba4c3fa6b010ea8fbb3e6ec1a7358a18ef2ec2
This commit is contained in:
parent
979b1f4164
commit
b53f089c87
@ -55,8 +55,8 @@ class Utils
|
||||
acc_accounts.code as codeCompte,
|
||||
acc_accounts.label as nomCompte
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres
|
||||
ON acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN users
|
||||
ON acc_transactions_users.id_user = users.id
|
||||
INNER JOIN acc_transactions
|
||||
ON acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN acc_transactions_lines
|
||||
@ -154,14 +154,14 @@ class Utils
|
||||
$tri = Utils::combinerTri($champsNom);
|
||||
$sql = sprintf(
|
||||
'SELECT
|
||||
membres.id as idUser,
|
||||
users.id as idUser,
|
||||
acc_accounts.id as idCompte,
|
||||
acc_accounts.code as codeCompte,
|
||||
acc_transactions_lines.credit as versement,
|
||||
acc_transactions.date
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres
|
||||
ON acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN users
|
||||
ON acc_transactions_users.id_user = users.id
|
||||
INNER JOIN acc_transactions
|
||||
ON acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN acc_transactions_lines
|
||||
@ -203,12 +203,12 @@ class Utils
|
||||
services_fees.id as idTarif,
|
||||
acc_accounts.id as idCompte,
|
||||
acc_accounts.code as codeCompte,
|
||||
membres.id as idUser,
|
||||
users.id as idUser,
|
||||
acc_transactions_lines.credit as versement,
|
||||
acc_transactions.date
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres
|
||||
ON acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN users
|
||||
ON acc_transactions_users.id_user = users.id
|
||||
INNER JOIN acc_transactions
|
||||
ON acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN services_users
|
||||
@ -253,12 +253,12 @@ class Utils
|
||||
0 as idTarif,
|
||||
acc_accounts.id as idCompte,
|
||||
acc_accounts.code as codeCompte,
|
||||
membres.id as idUser,
|
||||
users.id as idUser,
|
||||
acc_transactions_lines.credit as versement,
|
||||
acc_transactions.date
|
||||
FROM acc_transactions_users
|
||||
INNER JOIN membres
|
||||
ON acc_transactions_users.id_user = membres.id
|
||||
INNER JOIN users
|
||||
ON acc_transactions_users.id_user = users.id
|
||||
INNER JOIN acc_transactions
|
||||
ON acc_transactions_users.id_transaction = acc_transactions.id
|
||||
INNER JOIN acc_transactions_lines
|
||||
@ -293,17 +293,17 @@ class Utils
|
||||
$tri = Utils::combinerTri($champsNom);
|
||||
$sql = sprintf(
|
||||
'SELECT
|
||||
membres.id as idUser,
|
||||
membres.numero,
|
||||
membres.email,
|
||||
users.id as idUser,
|
||||
users.numero,
|
||||
users.email,
|
||||
row_number() over(order by %s) as rang,
|
||||
%s as nom,
|
||||
membres.adresse as adresse,
|
||||
membres.code_postal as codePostal,
|
||||
membres.ville as ville
|
||||
users.adresse as adresse,
|
||||
users.code_postal as codePostal,
|
||||
users.ville as ville
|
||||
FROM
|
||||
acc_transactions_users,
|
||||
membres,
|
||||
users,
|
||||
acc_transactions
|
||||
INNER JOIN acc_transactions_lines
|
||||
ON acc_transactions_lines.id_transaction = acc_transactions.id
|
||||
@ -312,9 +312,9 @@ class Utils
|
||||
AND
|
||||
acc_transactions_users.id_transaction = acc_transactions.id
|
||||
AND
|
||||
acc_transactions_users.id_user = membres.id
|
||||
acc_transactions_users.id_user = users.id
|
||||
)
|
||||
GROUP by membres.id
|
||||
GROUP by users.id
|
||||
ORDER by %1$s COLLATE U_NOCASE
|
||||
',
|
||||
$tri,
|
||||
@ -344,10 +344,10 @@ class Utils
|
||||
private static function combinerChamps($champs)
|
||||
{
|
||||
$op = ' || " " || ';
|
||||
$result = 'ifnull(membres.' . $champs[0] . ', "")';
|
||||
$result = 'ifnull(users.' . $champs[0] . ', "")';
|
||||
for ($i = 1; $i < count($champs); ++$i)
|
||||
{
|
||||
$result .= $op . 'ifnull(membres.' . $champs[$i] . ', "")';
|
||||
$result .= $op . 'ifnull(users.' . $champs[$i] . ', "")';
|
||||
}
|
||||
return 'trim(' . $result . ')';
|
||||
}
|
||||
@ -359,10 +359,10 @@ class Utils
|
||||
*/
|
||||
private static function combinerTri(array $champs) : string
|
||||
{
|
||||
$tri = 'membres.' . $champs[0];
|
||||
$tri = 'users.' . $champs[0];
|
||||
for ($i = 1; $i < count($champs); ++$i)
|
||||
{
|
||||
$tri .= ', membres.' . $champs[$i];
|
||||
$tri .= ', users.' . $champs[$i];
|
||||
}
|
||||
return $tri;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user