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/ShippingRepository.php 8 locations

@@ 153-158 (lines=6) @@
150
        }
151
152
        // oreder_date
153
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
154
            $date = $searchData['order_date_start'];
155
            $qb
156
                ->andWhere('o.order_date >= :order_date_start')
157
                ->setParameter('order_date_start', $date);
158
        }
159
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
160
            $date = clone $searchData['order_date_end'];
161
            $date = $date
@@ 159-166 (lines=8) @@
156
                ->andWhere('o.order_date >= :order_date_start')
157
                ->setParameter('order_date_start', $date);
158
        }
159
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
160
            $date = clone $searchData['order_date_end'];
161
            $date = $date
162
                ->modify('+1 days');
163
            $qb
164
                ->andWhere('o.order_date < :order_date_end')
165
                ->setParameter('order_date_end', $date);
166
        }
167
168
        // shipping_delivery_date
169
        if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) {
@@ 169-174 (lines=6) @@
166
        }
167
168
        // shipping_delivery_date
169
        if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) {
170
            $date = $searchData['shipping_delivery_date_start'];
171
            $qb
172
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
173
                ->setParameter('shipping_delivery_date_start', $date);
174
        }
175
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
176
            $date = clone $searchData['shipping_delivery_date_end'];
177
            $date = $date
@@ 175-182 (lines=8) @@
172
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
173
                ->setParameter('shipping_delivery_date_start', $date);
174
        }
175
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
176
            $date = clone $searchData['shipping_delivery_date_end'];
177
            $date = $date
178
                ->modify('+1 days');
179
            $qb
180
                ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end')
181
                ->setParameter('shipping_delivery_date_end', $date);
182
        }
183
184
        // shipping_date
185
        if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) {
@@ 185-190 (lines=6) @@
182
        }
183
184
        // shipping_date
185
        if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) {
186
            $date = $searchData['shipping_date_start'];
187
            $qb
188
                ->andWhere('s.shipping_date >= :shipping_date_start')
189
                ->setParameter('shipping_date_start', $date);
190
        }
191
        if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) {
192
            $date = clone $searchData['shipping_date_end'];
193
            $date = $date
@@ 191-198 (lines=8) @@
188
                ->andWhere('s.shipping_date >= :shipping_date_start')
189
                ->setParameter('shipping_date_start', $date);
190
        }
191
        if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) {
192
            $date = clone $searchData['shipping_date_end'];
193
            $date = $date
194
                ->modify('+1 days');
195
            $qb
196
                ->andWhere('s.shipping_date < :shipping_date_end')
197
                ->setParameter('shipping_date_end', $date);
198
        }
199
200
        // update_date
201
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 201-206 (lines=6) @@
198
        }
199
200
        // update_date
201
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
202
            $date = $searchData['update_date_start'];
203
            $qb
204
                ->andWhere('s.update_date >= :update_date_start')
205
                ->setParameter('update_date_start', $date);
206
        }
207
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
208
            $date = clone $searchData['update_date_end'];
209
            $date = $date
@@ 207-214 (lines=8) @@
204
                ->andWhere('s.update_date >= :update_date_start')
205
                ->setParameter('update_date_start', $date);
206
        }
207
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
208
            $date = clone $searchData['update_date_end'];
209
            $date = $date
210
                ->modify('+1 days');
211
            $qb
212
                ->andWhere('s.update_date < :update_date_end')
213
                ->setParameter('update_date_end', $date);
214
        }
215
216
        // payment_total
217
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {

src/Eccube/Repository/OrderRepository.php 12 locations

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