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['tel']) && StringUtil::isNotBlank($searchData['tel'])) {
@@ 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/OrderRepository.php 12 locations

@@ 199-204 (lines=6) @@
196
        }
197
198
        // oreder_date
199
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
200
            $date = $searchData['order_date_start'];
201
            $qb
202
                ->andWhere('o.create_date >= :order_date_start')
203
                ->setParameter('order_date_start', $date);
204
        }
205
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
206
            $date = clone $searchData['order_date_end'];
207
            $date = $date
@@ 205-212 (lines=8) @@
202
                ->andWhere('o.create_date >= :order_date_start')
203
                ->setParameter('order_date_start', $date);
204
        }
205
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
206
            $date = clone $searchData['order_date_end'];
207
            $date = $date
208
                ->modify('+1 days');
209
            $qb
210
                ->andWhere('o.create_date < :order_date_end')
211
                ->setParameter('order_date_end', $date);
212
        }
213
214
        // create_date
215
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 215-220 (lines=6) @@
212
        }
213
214
        // create_date
215
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
216
            $date = $searchData['update_date_start'];
217
            $qb
218
                ->andWhere('o.update_date >= :update_date_start')
219
                ->setParameter('update_date_start', $date);
220
        }
221
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
222
            $date = clone $searchData['update_date_end'];
223
            $date = $date
@@ 221-228 (lines=8) @@
218
                ->andWhere('o.update_date >= :update_date_start')
219
                ->setParameter('update_date_start', $date);
220
        }
221
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
222
            $date = clone $searchData['update_date_end'];
223
            $date = $date
224
                ->modify('+1 days');
225
            $qb
226
                ->andWhere('o.update_date < :update_date_end')
227
                ->setParameter('update_date_end', $date);
228
        }
229
230
        // payment_total
231
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
@@ 377-382 (lines=6) @@
374
        }
375
376
        // oreder_date
377
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
378
            $date = $searchData['order_date_start'];
379
            $qb
380
                ->andWhere('o.order_date >= :order_date_start')
381
                ->setParameter('order_date_start', $date);
382
        }
383
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
384
            $date = clone $searchData['order_date_end'];
385
            $date = $date
@@ 383-390 (lines=8) @@
380
                ->andWhere('o.order_date >= :order_date_start')
381
                ->setParameter('order_date_start', $date);
382
        }
383
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
384
            $date = clone $searchData['order_date_end'];
385
            $date = $date
386
                ->modify('+1 days');
387
            $qb
388
                ->andWhere('o.order_date < :order_date_end')
389
                ->setParameter('order_date_end', $date);
390
        }
391
392
        // payment_date
393
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
@@ 393-398 (lines=6) @@
390
        }
391
392
        // payment_date
393
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
394
            $date = $searchData['payment_date_start'];
395
            $qb
396
                ->andWhere('o.payment_date >= :payment_date_start')
397
                ->setParameter('payment_date_start', $date);
398
        }
399
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
400
            $date = clone $searchData['payment_date_end'];
401
            $date = $date
@@ 399-406 (lines=8) @@
396
                ->andWhere('o.payment_date >= :payment_date_start')
397
                ->setParameter('payment_date_start', $date);
398
        }
399
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
400
            $date = clone $searchData['payment_date_end'];
401
            $date = $date
402
                ->modify('+1 days');
403
            $qb
404
                ->andWhere('o.payment_date < :payment_date_end')
405
                ->setParameter('payment_date_end', $date);
406
        }
407
408
        // shipping_date
409
        if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) {
@@ 409-414 (lines=6) @@
406
        }
407
408
        // shipping_date
409
        if (!empty($searchData['shipping_date_start']) && $searchData['shipping_date_start']) {
410
            $date = $searchData['shipping_date_start'];
411
            $qb
412
                ->andWhere('o.shipping_date >= :shipping_date_start')
413
                ->setParameter('shipping_date_start', $date);
414
        }
415
        if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) {
416
            $date = clone $searchData['shipping_date_end'];
417
            $date = $date
@@ 415-422 (lines=8) @@
412
                ->andWhere('o.shipping_date >= :shipping_date_start')
413
                ->setParameter('shipping_date_start', $date);
414
        }
415
        if (!empty($searchData['shipping_date_end']) && $searchData['shipping_date_end']) {
416
            $date = clone $searchData['shipping_date_end'];
417
            $date = $date
418
                ->modify('+1 days');
419
            $qb
420
                ->andWhere('o.shipping_date < :shipping_date_end')
421
                ->setParameter('shipping_date_end', $date);
422
        }
423
424
        // update_date
425
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 425-430 (lines=6) @@
422
        }
423
424
        // update_date
425
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
426
            $date = $searchData['update_date_start'];
427
            $qb
428
                ->andWhere('o.update_date >= :update_date_start')
429
                ->setParameter('update_date_start', $date);
430
        }
431
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
432
            $date = clone $searchData['update_date_end'];
433
            $date = $date
@@ 431-438 (lines=8) @@
428
                ->andWhere('o.update_date >= :update_date_start')
429
                ->setParameter('update_date_start', $date);
430
        }
431
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
432
            $date = clone $searchData['update_date_end'];
433
            $date = $date
434
                ->modify('+1 days');
435
            $qb
436
                ->andWhere('o.update_date < :update_date_end')
437
                ->setParameter('update_date_end', $date);
438
        }
439
440
        // payment_total
441
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {

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