Overview
Comment:Correction : group by mal situé
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9efe281e4a761bc8cbf3cf6b3b6de166a17c9ef0
User & Date: bohwaz on 2014-12-18 16:06:49
Other Links: manifest | tags
Context
2014-12-18
16:43
Possibilité de requérir une version minimale de Garradin pour un plugin. Enregistrement de la configuration déporté à la destruction de l'objet. Instanciation de $plugin avant l'installation. check-in: bcc5556f06 user: bohwaz tags: trunk
16:06
Correction : group by mal situé check-in: 9efe281e4a user: bohwaz tags: trunk
2014-11-22
17:51
Sous-requête qui n'était pas correctement formulée check-in: 9d2c3747e3 user: bohwaz tags: trunk
Changes

Modified src/include/class.rappels.php from [2b30cb0cb2] to [b2fca7b211].

176
177
178
179
180
181
182


183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
			WHERE
				/* Inutile de sélectionner les membres sans email */
				m.email IS NOT NULL AND m.email != \'\'
				/* Les cotisations ponctuelles ne comptent pas */
				AND (c.fin IS NOT NULL OR c.duree IS NOT NULL)
				/* Rien nest envoyé aux membres des catégories cachées, logique */
				AND m.id_categorie NOT IN (SELECT id FROM membres_categories WHERE cacher = 1)


			ORDER BY r.delai ASC
		)
		WHERE nb_jours >= delai 
			/* Pour ne pas spammer on n\'envoie pas de rappel antérieur au dernier rappel déjà effectué */
			AND id NOT IN (SELECT id_membre FROM rappels_envoyes AS re 
				WHERE id_cotisation = re.id_cotisation 
				AND re.date >= date(expiration, delai || \' days\')
			)
		/* Grouper par membre, pour n\'envoyer qu\'un seul rappel par membre/cotise */
		GROUP BY id, id_cotisation
		ORDER BY nb_jours DESC;';

		$db->exec('BEGIN');
		$st = $db->prepare($query);
		$res = $st->execute();
		$re = new Rappels_Envoyes;








>
>








<
<







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192


193
194
195
196
197
198
199
			WHERE
				/* Inutile de sélectionner les membres sans email */
				m.email IS NOT NULL AND m.email != \'\'
				/* Les cotisations ponctuelles ne comptent pas */
				AND (c.fin IS NOT NULL OR c.duree IS NOT NULL)
				/* Rien nest envoyé aux membres des catégories cachées, logique */
				AND m.id_categorie NOT IN (SELECT id FROM membres_categories WHERE cacher = 1)
    		/* Grouper par membre, pour n\'envoyer qu\'un seul rappel par membre/cotise */
	    	GROUP BY m.id, r.id_cotisation
			ORDER BY r.delai ASC
		)
		WHERE nb_jours >= delai 
			/* Pour ne pas spammer on n\'envoie pas de rappel antérieur au dernier rappel déjà effectué */
			AND id NOT IN (SELECT id_membre FROM rappels_envoyes AS re 
				WHERE id_cotisation = re.id_cotisation 
				AND re.date >= date(expiration, delai || \' days\')
			)


		ORDER BY nb_jours DESC;';

		$db->exec('BEGIN');
		$st = $db->prepare($query);
		$res = $st->execute();
		$re = new Rappels_Envoyes;