@@ 146-152 (lines=7) @@ | ||
143 | ->andWhere('c.birth >= :birth_start') |
|
144 | ->setParameter('birth_start', $searchData['birth_start']); |
|
145 | } |
|
146 | if (!empty($searchData['birth_end']) && $searchData['birth_end']) { |
|
147 | $date = clone $searchData['birth_end']; |
|
148 | $date->modify('+1 days'); |
|
149 | $qb |
|
150 | ->andWhere('c.birth < :birth_end') |
|
151 | ->setParameter('birth_end', $date); |
|
152 | } |
|
153 | ||
154 | // tel |
|
155 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
@@ 192-198 (lines=7) @@ | ||
189 | ->andWhere('c.create_date >= :create_date_start') |
|
190 | ->setParameter('create_date_start', $searchData['create_date_start']); |
|
191 | } |
|
192 | if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) { |
|
193 | $date = clone $searchData['create_date_end']; |
|
194 | $date->modify('+1 days'); |
|
195 | $qb |
|
196 | ->andWhere('c.create_date < :create_date_end') |
|
197 | ->setParameter('create_date_end', $date); |
|
198 | } |
|
199 | ||
200 | // update_date |
|
201 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
@@ 206-212 (lines=7) @@ | ||
203 | ->andWhere('c.update_date >= :update_date_start') |
|
204 | ->setParameter('update_date_start', $searchData['update_date_start']); |
|
205 | } |
|
206 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
207 | $date = clone $searchData['update_date_end']; |
|
208 | $date->modify('+1 days'); |
|
209 | $qb |
|
210 | ->andWhere('c.update_date < :update_date_end') |
|
211 | ->setParameter('update_date_end', $date); |
|
212 | } |
|
213 | ||
214 | // last_buy |
|
215 | if (!empty($searchData['last_buy_start']) && $searchData['last_buy_start']) { |
|
@@ 220-226 (lines=7) @@ | ||
217 | ->andWhere('c.last_buy_date >= :last_buy_start') |
|
218 | ->setParameter('last_buy_start', $searchData['last_buy_start']); |
|
219 | } |
|
220 | if (!empty($searchData['last_buy_end']) && $searchData['last_buy_end']) { |
|
221 | $date = clone $searchData['last_buy_end']; |
|
222 | $date->modify('+1 days'); |
|
223 | $qb |
|
224 | ->andWhere('c.last_buy_date < :last_buy_end') |
|
225 | ->setParameter('last_buy_end', $date); |
|
226 | } |
|
227 | ||
228 | // status |
|
229 | if (!empty($searchData['customer_status']) && count($searchData['customer_status']) > 0) { |
@@ 256-261 (lines=6) @@ | ||
253 | } |
|
254 | ||
255 | // crate_date |
|
256 | if (!empty($searchData['create_date_start']) && $searchData['create_date_start']) { |
|
257 | $date = $searchData['create_date_start']; |
|
258 | $qb |
|
259 | ->andWhere('p.create_date >= :create_date_start') |
|
260 | ->setParameter('create_date_start', $date); |
|
261 | } |
|
262 | ||
263 | if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) { |
|
264 | $date = clone $searchData['create_date_end']; |
|
@@ 263-270 (lines=8) @@ | ||
260 | ->setParameter('create_date_start', $date); |
|
261 | } |
|
262 | ||
263 | if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) { |
|
264 | $date = clone $searchData['create_date_end']; |
|
265 | $date = $date |
|
266 | ->modify('+1 days'); |
|
267 | $qb |
|
268 | ->andWhere('p.create_date < :create_date_end') |
|
269 | ->setParameter('create_date_end', $date); |
|
270 | } |
|
271 | ||
272 | // update_date |
|
273 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
@@ 273-278 (lines=6) @@ | ||
270 | } |
|
271 | ||
272 | // update_date |
|
273 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
274 | $date = $searchData['update_date_start']; |
|
275 | $qb |
|
276 | ->andWhere('p.update_date >= :update_date_start') |
|
277 | ->setParameter('update_date_start', $date); |
|
278 | } |
|
279 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
280 | $date = clone $searchData['update_date_end']; |
|
281 | $date = $date |
|
@@ 279-286 (lines=8) @@ | ||
276 | ->andWhere('p.update_date >= :update_date_start') |
|
277 | ->setParameter('update_date_start', $date); |
|
278 | } |
|
279 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
280 | $date = clone $searchData['update_date_end']; |
|
281 | $date = $date |
|
282 | ->modify('+1 days'); |
|
283 | $qb |
|
284 | ->andWhere('p.update_date < :update_date_end') |
|
285 | ->setParameter('update_date_end', $date); |
|
286 | } |
|
287 | ||
288 | // Order By |
|
289 | $qb |
@@ 147-152 (lines=6) @@ | ||
144 | } |
|
145 | ||
146 | // oreder_date |
|
147 | if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) { |
|
148 | $date = $searchData['order_date_start']; |
|
149 | $qb |
|
150 | ->andWhere('o.order_date >= :order_date_start') |
|
151 | ->setParameter('order_date_start', $date); |
|
152 | } |
|
153 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
154 | $date = clone $searchData['order_date_end']; |
|
155 | $date = $date |
|
@@ 153-160 (lines=8) @@ | ||
150 | ->andWhere('o.order_date >= :order_date_start') |
|
151 | ->setParameter('order_date_start', $date); |
|
152 | } |
|
153 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
154 | $date = clone $searchData['order_date_end']; |
|
155 | $date = $date |
|
156 | ->modify('+1 days'); |
|
157 | $qb |
|
158 | ->andWhere('o.order_date < :order_date_end') |
|
159 | ->setParameter('order_date_end', $date); |
|
160 | } |
|
161 | ||
162 | // shipping_delivery_date |
|
163 | if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) { |
|
@@ 163-168 (lines=6) @@ | ||
160 | } |
|
161 | ||
162 | // shipping_delivery_date |
|
163 | if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) { |
|
164 | $date = $searchData['shipping_delivery_date_start']; |
|
165 | $qb |
|
166 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
167 | ->setParameter('shipping_delivery_date_start', $date); |
|
168 | } |
|
169 | if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) { |
|
170 | $date = clone $searchData['shipping_delivery_date_end']; |
|
171 | $date = $date |
|
@@ 169-176 (lines=8) @@ | ||
166 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
167 | ->setParameter('shipping_delivery_date_start', $date); |
|
168 | } |
|
169 | if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) { |
|
170 | $date = clone $searchData['shipping_delivery_date_end']; |
|
171 | $date = $date |
|
172 | ->modify('+1 days'); |
|
173 | $qb |
|
174 | ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end') |
|
175 | ->setParameter('shipping_delivery_date_end', $date); |
|
176 | } |
|
177 | ||
178 | // shipping_date |
|
179 | if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) { |
|
@@ 179-184 (lines=6) @@ | ||
176 | } |
|
177 | ||
178 | // shipping_date |
|
179 | if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) { |
|
180 | $date = $searchData['shipping_date_start']; |
|
181 | $qb |
|
182 | ->andWhere('s.shipping_date >= :shipping_date_start') |
|
183 | ->setParameter('shipping_date_start', $date); |
|
184 | } |
|
185 | if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) { |
|
186 | $date = clone $searchData['shipping_date_end']; |
|
187 | $date = $date |
|
@@ 185-192 (lines=8) @@ | ||
182 | ->andWhere('s.shipping_date >= :shipping_date_start') |
|
183 | ->setParameter('shipping_date_start', $date); |
|
184 | } |
|
185 | if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) { |
|
186 | $date = clone $searchData['shipping_date_end']; |
|
187 | $date = $date |
|
188 | ->modify('+1 days'); |
|
189 | $qb |
|
190 | ->andWhere('s.shipping_date < :shipping_date_end') |
|
191 | ->setParameter('shipping_date_end', $date); |
|
192 | } |
|
193 | ||
194 | // update_date |
|
195 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
@@ 195-200 (lines=6) @@ | ||
192 | } |
|
193 | ||
194 | // update_date |
|
195 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
196 | $date = $searchData['update_date_start']; |
|
197 | $qb |
|
198 | ->andWhere('s.update_date >= :update_date_start') |
|
199 | ->setParameter('update_date_start', $date); |
|
200 | } |
|
201 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
202 | $date = clone $searchData['update_date_end']; |
|
203 | $date = $date |
|
@@ 201-208 (lines=8) @@ | ||
198 | ->andWhere('s.update_date >= :update_date_start') |
|
199 | ->setParameter('update_date_start', $date); |
|
200 | } |
|
201 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
202 | $date = clone $searchData['update_date_end']; |
|
203 | $date = $date |
|
204 | ->modify('+1 days'); |
|
205 | $qb |
|
206 | ->andWhere('s.update_date < :update_date_end') |
|
207 | ->setParameter('update_date_end', $date); |
|
208 | } |
|
209 | ||
210 | // payment_total |
|
211 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
@@ 188-193 (lines=6) @@ | ||
185 | } |
|
186 | ||
187 | // oreder_date |
|
188 | if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) { |
|
189 | $date = $searchData['order_date_start']; |
|
190 | $qb |
|
191 | ->andWhere('o.create_date >= :order_date_start') |
|
192 | ->setParameter('order_date_start', $date); |
|
193 | } |
|
194 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
195 | $date = clone $searchData['order_date_end']; |
|
196 | $date = $date |
|
@@ 194-201 (lines=8) @@ | ||
191 | ->andWhere('o.create_date >= :order_date_start') |
|
192 | ->setParameter('order_date_start', $date); |
|
193 | } |
|
194 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
195 | $date = clone $searchData['order_date_end']; |
|
196 | $date = $date |
|
197 | ->modify('+1 days'); |
|
198 | $qb |
|
199 | ->andWhere('o.create_date < :order_date_end') |
|
200 | ->setParameter('order_date_end', $date); |
|
201 | } |
|
202 | ||
203 | // create_date |
|
204 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
@@ 204-209 (lines=6) @@ | ||
201 | } |
|
202 | ||
203 | // create_date |
|
204 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
205 | $date = $searchData['update_date_start']; |
|
206 | $qb |
|
207 | ->andWhere('o.update_date >= :update_date_start') |
|
208 | ->setParameter('update_date_start', $date); |
|
209 | } |
|
210 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
211 | $date = clone $searchData['update_date_end']; |
|
212 | $date = $date |
|
@@ 210-217 (lines=8) @@ | ||
207 | ->andWhere('o.update_date >= :update_date_start') |
|
208 | ->setParameter('update_date_start', $date); |
|
209 | } |
|
210 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
211 | $date = clone $searchData['update_date_end']; |
|
212 | $date = $date |
|
213 | ->modify('+1 days'); |
|
214 | $qb |
|
215 | ->andWhere('o.update_date < :update_date_end') |
|
216 | ->setParameter('update_date_end', $date); |
|
217 | } |
|
218 | ||
219 | // payment_total |
|
220 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
@@ 368-373 (lines=6) @@ | ||
365 | } |
|
366 | ||
367 | // oreder_date |
|
368 | if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) { |
|
369 | $date = $searchData['order_date_start']; |
|
370 | $qb |
|
371 | ->andWhere('o.order_date >= :order_date_start') |
|
372 | ->setParameter('order_date_start', $date); |
|
373 | } |
|
374 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
375 | $date = clone $searchData['order_date_end']; |
|
376 | $date = $date |
|
@@ 374-381 (lines=8) @@ | ||
371 | ->andWhere('o.order_date >= :order_date_start') |
|
372 | ->setParameter('order_date_start', $date); |
|
373 | } |
|
374 | if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
375 | $date = clone $searchData['order_date_end']; |
|
376 | $date = $date |
|
377 | ->modify('+1 days'); |
|
378 | $qb |
|
379 | ->andWhere('o.order_date < :order_date_end') |
|
380 | ->setParameter('order_date_end', $date); |
|
381 | } |
|
382 | ||
383 | // payment_date |
|
384 | if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) { |
|
@@ 384-389 (lines=6) @@ | ||
381 | } |
|
382 | ||
383 | // payment_date |
|
384 | if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) { |
|
385 | $date = $searchData['payment_date_start']; |
|
386 | $qb |
|
387 | ->andWhere('o.payment_date >= :payment_date_start') |
|
388 | ->setParameter('payment_date_start', $date); |
|
389 | } |
|
390 | if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) { |
|
391 | $date = clone $searchData['payment_date_end']; |
|
392 | $date = $date |
|
@@ 390-397 (lines=8) @@ | ||
387 | ->andWhere('o.payment_date >= :payment_date_start') |
|
388 | ->setParameter('payment_date_start', $date); |
|
389 | } |
|
390 | if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) { |
|
391 | $date = clone $searchData['payment_date_end']; |
|
392 | $date = $date |
|
393 | ->modify('+1 days'); |
|
394 | $qb |
|
395 | ->andWhere('o.payment_date < :payment_date_end') |
|
396 | ->setParameter('payment_date_end', $date); |
|
397 | } |
|
398 | ||
399 | // update_date |
|
400 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
@@ 400-405 (lines=6) @@ | ||
397 | } |
|
398 | ||
399 | // update_date |
|
400 | if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
401 | $date = $searchData['update_date_start']; |
|
402 | $qb |
|
403 | ->andWhere('o.update_date >= :update_date_start') |
|
404 | ->setParameter('update_date_start', $date); |
|
405 | } |
|
406 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
407 | $date = clone $searchData['update_date_end']; |
|
408 | $date = $date |
|
@@ 406-413 (lines=8) @@ | ||
403 | ->andWhere('o.update_date >= :update_date_start') |
|
404 | ->setParameter('update_date_start', $date); |
|
405 | } |
|
406 | if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
407 | $date = clone $searchData['update_date_end']; |
|
408 | $date = $date |
|
409 | ->modify('+1 days'); |
|
410 | $qb |
|
411 | ->andWhere('o.update_date < :update_date_end') |
|
412 | ->setParameter('update_date_end', $date); |
|
413 | } |
|
414 | ||
415 | // payment_total |
|
416 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
@@ 449-454 (lines=6) @@ | ||
446 | } |
|
447 | ||
448 | // お届け予定日(Shipping.delivery_date) |
|
449 | if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) { |
|
450 | $date = $searchData['shipping_delivery_date_start']; |
|
451 | $qb |
|
452 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
453 | ->setParameter('shipping_delivery_date_start', $date); |
|
454 | } |
|
455 | if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) { |
|
456 | $date = clone $searchData['shipping_delivery_date_end']; |
|
457 | $date = $date |
|
@@ 455-462 (lines=8) @@ | ||
452 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
453 | ->setParameter('shipping_delivery_date_start', $date); |
|
454 | } |
|
455 | if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) { |
|
456 | $date = clone $searchData['shipping_delivery_date_end']; |
|
457 | $date = $date |
|
458 | ->modify('+1 days'); |
|
459 | $qb |
|
460 | ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end') |
|
461 | ->setParameter('shipping_delivery_date_end', $date); |
|
462 | } |
|
463 | ||
464 | // Order By |
|
465 | $qb->orderBy('o.update_date', 'DESC'); |