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