Code Duplication    Length = 6-8 lines in 28 locations

src/Eccube/Repository/CustomerRepository.php 4 locations

@@ 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) {

src/Eccube/Repository/ProductRepository.php 4 locations

@@ 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

src/Eccube/Repository/OrderRepository.php 12 locations

@@ 186-191 (lines=6) @@
183
        }
184
185
        // oreder_date
186
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
187
            $date = $searchData['order_date_start'];
188
            $qb
189
                ->andWhere('o.create_date >= :order_date_start')
190
                ->setParameter('order_date_start', $date);
191
        }
192
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
193
            $date = clone $searchData['order_date_end'];
194
            $date = $date
@@ 192-199 (lines=8) @@
189
                ->andWhere('o.create_date >= :order_date_start')
190
                ->setParameter('order_date_start', $date);
191
        }
192
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
193
            $date = clone $searchData['order_date_end'];
194
            $date = $date
195
                ->modify('+1 days');
196
            $qb
197
                ->andWhere('o.create_date < :order_date_end')
198
                ->setParameter('order_date_end', $date);
199
        }
200
201
        // create_date
202
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 202-207 (lines=6) @@
199
        }
200
201
        // create_date
202
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
203
            $date = $searchData['update_date_start'];
204
            $qb
205
                ->andWhere('o.update_date >= :update_date_start')
206
                ->setParameter('update_date_start', $date);
207
        }
208
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
209
            $date = clone $searchData['update_date_end'];
210
            $date = $date
@@ 208-215 (lines=8) @@
205
                ->andWhere('o.update_date >= :update_date_start')
206
                ->setParameter('update_date_start', $date);
207
        }
208
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
209
            $date = clone $searchData['update_date_end'];
210
            $date = $date
211
                ->modify('+1 days');
212
            $qb
213
                ->andWhere('o.update_date < :update_date_end')
214
                ->setParameter('update_date_end', $date);
215
        }
216
217
        // payment_total
218
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
@@ 366-371 (lines=6) @@
363
        }
364
365
        // oreder_date
366
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
367
            $date = $searchData['order_date_start'];
368
            $qb
369
                ->andWhere('o.order_date >= :order_date_start')
370
                ->setParameter('order_date_start', $date);
371
        }
372
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
373
            $date = clone $searchData['order_date_end'];
374
            $date = $date
@@ 372-379 (lines=8) @@
369
                ->andWhere('o.order_date >= :order_date_start')
370
                ->setParameter('order_date_start', $date);
371
        }
372
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
373
            $date = clone $searchData['order_date_end'];
374
            $date = $date
375
                ->modify('+1 days');
376
            $qb
377
                ->andWhere('o.order_date < :order_date_end')
378
                ->setParameter('order_date_end', $date);
379
        }
380
381
        // payment_date
382
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
@@ 382-387 (lines=6) @@
379
        }
380
381
        // payment_date
382
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
383
            $date = $searchData['payment_date_start'];
384
            $qb
385
                ->andWhere('o.payment_date >= :payment_date_start')
386
                ->setParameter('payment_date_start', $date);
387
        }
388
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
389
            $date = clone $searchData['payment_date_end'];
390
            $date = $date
@@ 388-395 (lines=8) @@
385
                ->andWhere('o.payment_date >= :payment_date_start')
386
                ->setParameter('payment_date_start', $date);
387
        }
388
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
389
            $date = clone $searchData['payment_date_end'];
390
            $date = $date
391
                ->modify('+1 days');
392
            $qb
393
                ->andWhere('o.payment_date < :payment_date_end')
394
                ->setParameter('payment_date_end', $date);
395
        }
396
397
        // update_date
398
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 398-403 (lines=6) @@
395
        }
396
397
        // update_date
398
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
399
            $date = $searchData['update_date_start'];
400
            $qb
401
                ->andWhere('o.update_date >= :update_date_start')
402
                ->setParameter('update_date_start', $date);
403
        }
404
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
405
            $date = clone $searchData['update_date_end'];
406
            $date = $date
@@ 404-411 (lines=8) @@
401
                ->andWhere('o.update_date >= :update_date_start')
402
                ->setParameter('update_date_start', $date);
403
        }
404
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
405
            $date = clone $searchData['update_date_end'];
406
            $date = $date
407
                ->modify('+1 days');
408
            $qb
409
                ->andWhere('o.update_date < :update_date_end')
410
                ->setParameter('update_date_end', $date);
411
        }
412
413
        // payment_total
414
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
@@ 447-452 (lines=6) @@
444
        }
445
446
        // お届け予定日(Shipping.delivery_date)
447
        if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) {
448
            $date = $searchData['shipping_delivery_date_start'];
449
            $qb
450
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
451
                ->setParameter('shipping_delivery_date_start', $date);
452
        }
453
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
454
            $date = clone $searchData['shipping_delivery_date_end'];
455
            $date = $date
@@ 453-460 (lines=8) @@
450
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
451
                ->setParameter('shipping_delivery_date_start', $date);
452
        }
453
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
454
            $date = clone $searchData['shipping_delivery_date_end'];
455
            $date = $date
456
                ->modify('+1 days');
457
            $qb
458
                ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end')
459
                ->setParameter('shipping_delivery_date_end', $date);
460
        }
461
462
        // Order By
463
        $qb->orderBy('o.update_date', 'DESC');

src/Eccube/Repository/ShippingRepository.php 8 locations

@@ 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'])) {