https://api.nomadcloud.fr/api/histories-analytics?month=7&nbrMonth=6&optionSelect=V&page=1&pointOfSaleId=4&year=2025

Query Metrics

220 Database Queries
34 Different statements
34871.26 ms Query time
3 Invalid entities

Queries

Group similar statements

# Time Info
1 0.43 ms
SELECT t0.id AS id_1, t0.email AS email_2, t0.nom AS nom_3, t0.prenom AS prenom_4, t0.roles AS roles_5, t0.password AS password_6, t0.internal_ref AS internal_ref_7, t0.origin_id AS origin_id_8, t0.parent_origin_id AS parent_origin_id_9, t0.picto AS picto_10, t0.parent_id AS parent_id_11, t0.point_of_sale_id AS point_of_sale_id_12, t0.role_app_id AS role_app_id_13, t0.organisation_id AS organisation_id_14 FROM user t0 WHERE t0.email = ? LIMIT 1
Parameters:
[
  "liteyear@nomad.fr"
]
2 0.78 ms
SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3, t0.code AS code_4, t0.operator_id AS operator_id_5, t0.organisation_id AS organisation_id_6 FROM point_of_sale t0 WHERE t0.id = ? LIMIT 1
Parameters:
[
  "4"
]
3 0.40 ms
SELECT t0.id AS id_1, t0.code AS code_2, t0.nom AS nom_3, t0.description AS description_4, t0.operator_id AS operator_id_5 FROM etat_production t0 WHERE t0.nom = ? LIMIT 1
Parameters:
[
  "Racco KO"
]
4 0.38 ms
SELECT t0.id AS id_1, t0.code AS code_2, t0.nom AS nom_3, t0.description AS description_4, t0.operator_id AS operator_id_5 FROM etat_production t0 WHERE t0.nom = ? LIMIT 1
Parameters:
[
  "Raccorde"
]
5 2.32 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  7
  2025
  "1053520"
]
6 261.28 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
]
7 3.68 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
]
8 222.26 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
]
9 220.94 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
]
10 221.00 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
  31
  32
  33
]
11 218.69 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  7
  2025
]
12 220.06 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  7
  2025
]
13 217.27 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  7
  2025
  2
]
14 2.93 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  7
  2025
]
15 216.10 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  7
  2025
  "2026-02-10 10:37:43"
]
16 216.11 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
17 0.70 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  7
  2025
  "2026-02-10 10:37:43"
]
18 215.50 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
19 0.69 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  7
  2025
  "2026-02-10 10:37:43"
]
20 217.46 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
21 487.10 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
22 220.67 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  7
  2025
]
23 239.31 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
24 231.77 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
25 226.68 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
26 217.93 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
27 215.93 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
28 78.48 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
29 58.63 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
30 220.50 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
31 224.48 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
]
32 215.29 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  7
  2025
]
33 230.44 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
34 480.01 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
35 215.41 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "opt" => "OUI"
]
36 216.69 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
37 213.77 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "opt" => "OUI"
]
38 212.39 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "opt" => "NON"
]
39 212.46 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 7
  "annee" => 2025
  "opt" => "OUI"
]
40 207.68 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  7
  2025
  1
  3
]
41 2.52 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  6
  2025
  "1053520"
]
42 206.43 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
]
43 4.24 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
]
44 213.84 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
]
45 212.35 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
]
46 210.95 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
  31
  32
  33
]
47 207.93 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  6
  2025
]
48 210.01 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  6
  2025
]
49 208.54 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  6
  2025
  2
]
50 2.77 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  6
  2025
]
51 206.03 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  6
  2025
  "2026-02-10 10:37:50"
]
52 205.64 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
53 0.69 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  6
  2025
  "2026-02-10 10:37:50"
]
54 206.53 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
55 0.70 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  6
  2025
  "2026-02-10 10:37:50"
]
56 207.79 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
57 468.93 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
58 214.37 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  6
  2025
]
59 208.80 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
60 210.37 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
61 207.65 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
62 215.97 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
63 209.36 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
64 82.89 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
65 58.97 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
66 215.15 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
67 209.16 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
]
68 207.81 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  6
  2025
]
69 225.09 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
70 465.35 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
71 217.56 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "opt" => "OUI"
]
72 217.06 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
73 202.52 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "opt" => "OUI"
]
74 207.03 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "opt" => "NON"
]
75 201.60 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 6
  "annee" => 2025
  "opt" => "OUI"
]
76 198.60 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  6
  2025
  1
  3
]
77 2.55 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  5
  2025
  "1053520"
]
78 196.83 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
]
79 4.63 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
]
80 202.66 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
]
81 204.89 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
]
82 202.67 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
  31
  32
  33
]
83 197.30 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  5
  2025
]
84 199.84 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  5
  2025
]
85 197.30 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  5
  2025
  2
]
86 2.80 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  5
  2025
]
87 199.29 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  5
  2025
  "2026-02-10 10:37:56"
]
88 196.17 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
89 197.62 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  5
  2025
  "2026-02-10 10:37:57"
]
90 197.53 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
91 0.74 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  5
  2025
  "2026-02-10 10:37:57"
]
92 198.78 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
93 452.19 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
94 213.78 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  5
  2025
]
95 190.81 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
96 196.15 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
97 197.27 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
98 192.24 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
99 195.59 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
100 87.76 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
101 61.16 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
102 200.16 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
103 206.34 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
]
104 192.98 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  5
  2025
]
105 208.51 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
106 437.35 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
107 197.64 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "opt" => "OUI"
]
108 199.56 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
109 288.32 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "opt" => "OUI"
]
110 271.62 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "opt" => "NON"
]
111 194.76 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 5
  "annee" => 2025
  "opt" => "OUI"
]
112 186.18 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  5
  2025
  1
  3
]
113 2.50 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  4
  2025
  "1053520"
]
114 184.41 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
]
115 4.92 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
]
116 192.56 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
]
117 192.72 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
]
118 201.30 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
  31
  32
  33
]
119 193.15 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  4
  2025
]
120 198.17 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  4
  2025
]
121 194.80 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  4
  2025
  2
]
122 2.82 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  4
  2025
]
123 194.18 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  4
  2025
  "2026-02-10 10:38:03"
]
124 194.22 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
125 194.28 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  4
  2025
  "2026-02-10 10:38:04"
]
126 192.68 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
127 0.66 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  4
  2025
  "2026-02-10 10:38:04"
]
128 196.72 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
129 464.77 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
130 198.06 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  4
  2025
]
131 200.44 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
132 197.13 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
133 179.42 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
134 182.21 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
135 183.78 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
136 99.87 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
137 67.55 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
138 191.21 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
139 182.49 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
]
140 182.19 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  4
  2025
]
141 196.60 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
142 447.78 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
143 168.88 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "opt" => "OUI"
]
144 93.07 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
145 106.38 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "opt" => "OUI"
]
146 101.81 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "opt" => "NON"
]
147 137.42 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 4
  "annee" => 2025
  "opt" => "OUI"
]
148 84.95 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  4
  2025
  1
  3
]
149 5.34 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  3
  2025
  "1053520"
]
150 120.51 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
]
151 4.84 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
]
152 138.21 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
]
153 129.69 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
]
154 143.49 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
  31
  32
  33
]
155 121.50 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  3
  2025
]
156 137.07 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  3
  2025
]
157 120.43 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  3
  2025
  2
]
158 4.37 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  3
  2025
]
159 133.69 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  3
  2025
  "2026-02-10 10:38:09"
]
160 119.27 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
161 0.73 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  3
  2025
  "2026-02-10 10:38:09"
]
162 131.45 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
163 0.71 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  3
  2025
  "2026-02-10 10:38:09"
]
164 118.27 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
165 271.72 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
166 128.82 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  3
  2025
]
167 127.71 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
168 115.53 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
169 131.95 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
170 141.71 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
171 129.78 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
172 100.82 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
173 68.86 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
174 132.31 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
175 150.06 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
]
176 127.38 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  3
  2025
]
177 156.11 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
178 313.26 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
179 129.11 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "opt" => "OUI"
]
180 129.14 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
181 103.78 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "opt" => "OUI"
]
182 126.36 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "opt" => "NON"
]
183 122.02 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 3
  "annee" => 2025
  "opt" => "OUI"
]
184 98.12 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  3
  2025
  1
  3
]
185 5.03 ms
SELECT AVG(s0_.note_satisfaction) AS sclr_0 FROM satisfaction_client s0_ LEFT JOIN history h1_ ON s0_.history_id = h1_.id LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id WHERE MONTH(s0_.date_contrat) = ? AND YEAR(s0_.date_contrat) = ? AND s0_.cod_poin_vent = ?
Parameters:
[
  2
  2025
  "1053520"
]
186 121.79 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
]
187 5.27 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
]
188 143.67 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 3) OR (h0_.category_id IN (31) AND h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444))) ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
]
189 114.79 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.date_racc IS NOT NULL AND (h0_.category_id IN (1, 2, 3) OR h0_.product_id IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444)) ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
]
190 89.26 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?, ?) AND h0_.category_id IN (31, 32, 33, 48) AND h0_.date_racc IS NOT NULL AND h0_.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379, 441, 442, 443, 444) ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
  31
  32
  33
]
191 103.57 ms
SELECT COUNT(DISTINCT u0_.id) AS sclr_0 FROM history h1_ LEFT JOIN cluster c2_ ON h1_.cluster_id = c2_.id LEFT JOIN point_of_sale p3_ ON h1_.point_of_sale_id = p3_.id LEFT JOIN user u0_ ON h1_.seller_id = u0_.id WHERE h1_.point_of_sale_id = ? AND MONTH(h1_.date_vente_valid_b) = ? AND YEAR(h1_.date_vente_valid_b) = ?
Parameters:
[
  4
  2
  2025
]
192 117.89 ms
SELECT COUNT(h0_.id) / NULLIF(COUNT(DISTINCT u1_.id), 0) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p2_ ON h0_.point_of_sale_id = p2_.id LEFT JOIN cluster c3_ ON h0_.cluster_id = c3_.id LEFT JOIN user u1_ ON h0_.seller_id = u1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ?
Parameters:
[
  4
  2
  2025
]
193 108.70 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.etat_id = ?
Parameters:
[
  4
  2
  2025
  2
]
194 4.33 ms
SELECT SUM(n0_.vv) AS sclr_0 FROM nmd_objectif_clusters n0_ WHERE n0_.cpv = ? AND n0_.mois = ? AND n0_.year = ?
Parameters:
[
  "1053520"
  2
  2025
]
195 86.14 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  2
  2025
  "2026-02-10 10:38:13"
]
196 106.53 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
197 0.73 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  2
  2025
  "2026-02-10 10:38:13"
]
198 109.34 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
199 0.78 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_vente_valid_b) = ? AND YEAR(h0_.date_vente_valid_b) = ? AND h0_.date_vente_valid_b <= ?
Parameters:
[
  4
  2
  2025
  "2026-02-10 10:38:13"
]
200 107.91 ms
SELECT COUNT(DISTINCT DAY(p.date_vente_valid_b))
        FROM history p
        WHERE p.point_of_sale_id = :pointOfSale
        AND MONTH(p.date_vente_valid_b) = :mois
        AND YEAR(p.date_vente_valid_b) = :annee
        AND DAYOFWEEK(p.date_vente_valid_b) >= 2 AND DAYOFWEEK(p.date_vente_valid_b) <= 6  -- Jours de travail (lundi à vendredi)
        AND p.date_vente_valid_b <= CURDATE()  -- Jusqu'à aujourd'hui
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
201 251.99 ms
SELECT COUNT(DISTINCT result.titulaire_email) AS total_vente
            FROM (
                SELECT p1.titulaire_email
                FROM history p1
                LEFT JOIN cluster c1 ON c1.id=p1.cluster_id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                SELECT p2.titulaire_email
                FROM history p2
                LEFT JOIN cluster c2 ON c2.id=p2.cluster_id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        ) AS result
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
202 124.59 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.fixe_chainage IS NOT NULL AND h0_.category_id IN (31, 32, 33)
Parameters:
[
  4
  2
  2025
]
203 114.55 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
204 92.96 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
          AND (p.category_id NOT IN (2, 31, 32, 33,48) OR p.product_id IN(150,262,264,266,334,335,341,344,345,379))
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
205 114.99 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc IS NOT NULL
          AND DATEDIFF(p.date_racc, p.date_resiliation) > -31
         AND 
		  (
            p.category_id IN(1,3) 
            OR 
            ( 
                p.category_id IN(31) AND p.product_id IN(150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444)
            ) )
         AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
206 144.94 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
207 95.13 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.date_resiliation IS NOT NULL
          AND p.date_racc  IS NOT NULL
          AND DATEDIFF(p.date_racc , p.date_resiliation) > -31
          AND p.category_id IN(31,32,33,48) 
     AND p.product_id NOT IN (150, 262, 264, 266, 334, 335, 341, 344, 345, 379,441,442,443,444) AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
208 102.23 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
            OR p.fixe_autre IS NOT NULL
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
209 69.50 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id IN (SELECT DISTINCT(id) FROM category_product WHERE parent_category_id =4)
          AND (
            p.fixe_chainage IS NOT NULL 
        )
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
210 181.16 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total_vente
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.category_id NOT IN (2)
          AND MONTH(p.date_cmd_a) = :mois
          AND YEAR(p.date_cmd_a) = :annee
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
211 105.35 ms
SELECT COUNT(p.id) AS total_vente, p.identity_ctrl
        FROM history p
        LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
        LEFT JOIN cluster c ON p.cluster_id = c.id
        WHERE p.point_of_sale_id = :pointOfSale
          AND p.identity_ctrl IS NOT NULL 
         
     AND MONTH(p.date_vente_valid_b) = :mois AND YEAR(p.date_vente_valid_b) = :annee GROUP BY p.identity_ctrl
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
]
212 168.03 ms
SELECT COUNT(DISTINCT h0_.titulaire_email) AS sclr_0 FROM history h0_ LEFT JOIN cluster c1_ ON h0_.cluster_id = c1_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ?
Parameters:
[
  4
  2
  2025
]
213 111.10 ms
SELECT COUNT(DISTINCT p.titulaire_email) AS total, WEEK(p.date_cmd_a,3) AS semaine
            FROM history p
            LEFT JOIN cluster c ON c.id = p.cluster_id
            WHERE p.point_of_sale_id = :pointOfSale AND MONTH(p.date_cmd_a) = :mois AND YEAR(p.date_cmd_a) = :annee AND p.fixe_chainage IS NOT NULL AND p.category_id IN (:cat0,:cat1,:cat2)
            GROUP BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "cat0" => 31
  "cat1" => 32
  "cat2" => 33
]
214 320.46 ms
SELECT 
                COUNT(DISTINCT result.titulaire_email) AS total, 
                WEEK(result.date_cmd_a, 3) AS semaine
            FROM (
                -- Partie 1 : Catégorie 32 avec emails en catégorie 1
                SELECT p1.titulaire_email, p1.date_cmd_a
                FROM history p1
                LEFT JOIN cluster c1 ON p1.cluster_id = c1.id
                WHERE p1.category_id = :cat1
                  AND p1.point_of_sale_id = :pointOfSale
                  AND MONTH(p1.date_cmd_a) = :mois
                  AND YEAR(p1.date_cmd_a) = :annee
                  AND p1.titulaire_email IN (
                      SELECT DISTINCT p_sub1.titulaire_email
                      FROM history p_sub1
                      WHERE p_sub1.category_id = 1
                        AND p_sub1.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub1.date_cmd_a) = :mois
                        AND YEAR(p_sub1.date_cmd_a) = :annee
                  )
        
                UNION
                -- Partie 2 : Catégorie 31 avec emails en catégorie 1 ou 3
                SELECT p2.titulaire_email, p2.date_cmd_a
                FROM history p2
                LEFT JOIN cluster c2 ON p2.cluster_id = c2.id
                WHERE p2.category_id = :cat2
                  AND p2.point_of_sale_id = :pointOfSale
                  AND MONTH(p2.date_cmd_a) = :mois
                  AND YEAR(p2.date_cmd_a) = :annee
                  AND p2.titulaire_email IN (
                      SELECT DISTINCT p_sub2.titulaire_email
                      FROM history p_sub2
                      WHERE p_sub2.category_id IN (1, 3)
                        AND p_sub2.point_of_sale_id = :pointOfSale
                        AND MONTH(p_sub2.date_cmd_a) = :mois
                        AND YEAR(p_sub2.date_cmd_a) = :annee
                  )
        
            ) AS result
            GROUP BY WEEK(result.date_cmd_a, 3)
            ORDER BY semaine
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "cat1" => 32
  "cat2" => 31
]
215 173.53 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.portabilite = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "opt" => "OUI"
]
216 102.30 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt AND p.prise_existante_commande = :opt2
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "opt" => "NON"
  "opt2" => "OUI"
]
217 166.83 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_saisie_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "opt" => "OUI"
]
218 89.30 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "opt" => "NON"
]
219 97.03 ms
SELECT COUNT(DISTINCT p.id) AS total_vente
            FROM history p
            LEFT JOIN point_of_sale po ON p.point_of_sale_id = po.id
            LEFT JOIN cluster c ON c.id =p.cluster_id
        
            WHERE p.point_of_sale_id = :pointOfSale
              AND p.category_id IN (1,3)
              AND MONTH(p.date_cmd_a) = :mois
              AND YEAR(p.date_cmd_a) = :annee
         AND p.prise_existante_commande = :opt
Parameters:
[
  "pointOfSale" => 4
  "mois" => 2
  "annee" => 2025
  "opt" => "OUI"
]
220 171.58 ms
SELECT COUNT(h0_.id) AS sclr_0 FROM history h0_ LEFT JOIN point_of_sale p1_ ON h0_.point_of_sale_id = p1_.id LEFT JOIN cluster c2_ ON h0_.cluster_id = c2_.id WHERE h0_.point_of_sale_id = ? AND MONTH(h0_.date_cmd_a) = ? AND YEAR(h0_.date_cmd_a) = ? AND h0_.category_id IN (?, ?) ORDER BY sclr_0 DESC
Parameters:
[
  4
  2
  2025
  1
  3
]

Database Connections

Name Service
default doctrine.dbal.default_connection

Entity Managers

Name Service
default doctrine.orm.default_entity_manager

Second Level Cache

Second Level Cache is not enabled.

Entities Mapping

Class Mapping errors
App\Entity\User
  • The mappings App\Entity\User#nmdArretCuivres and App\Entity\NmdArretCuivre#user are inconsistent with each other.
  • The mappings App\Entity\User#nmdArretFttbs and App\Entity\NmdArretFttb#user are inconsistent with each other.
App\Entity\PointOfSale No errors.
App\Entity\RoleApp No errors.
App\Entity\Organisation No errors.
App\Entity\Operator No errors.
App\Entity\Declarative No errors.
App\Entity\InterventionPlace No errors.
App\Entity\Production No errors.
App\Entity\History No errors.
App\Entity\DistributionAdresse No errors.
App\Entity\ObjectivesManagement No errors.
App\Entity\IncidentsTickets No errors.
App\Entity\SchedulerSector No errors.
App\Entity\SalesCoachProfile No errors.
App\Entity\SalesCoachInteraction No errors.
App\Entity\UsersRefExterne No errors.
App\Entity\NmdAdressesIncomming No errors.
App\Entity\NmdArretCuivre
  • The association App\Entity\NmdArretCuivre#user refers to the inverse side field App\Entity\User#NmdArretCuivres which does not exist.
App\Entity\NmdArretFttb
  • The association App\Entity\NmdArretFttb#user refers to the inverse side field App\Entity\User#NmdArretFttbs which does not exist.
App\Entity\TourneeToken No errors.
App\Entity\EtatProduction No errors.
App\Entity\SatisfactionClient No errors.
App\Entity\Cluster No errors.
App\Entity\NmdAppPanier No errors.
App\Entity\NmdModules No errors.
App\Entity\ProspectionCycle No errors.
App\Entity\NmdObjectifClusters No errors.