Code Duplication    Length = 5-8 lines in 28 locations

src/Eccube/Repository/CustomerRepository.php 4 locations

@@ 190-196 (lines=7) @@
187
                ->andWhere('c.birth >= :birth_start')
188
                ->setParameter('birth_start', $searchData['birth_start']);
189
        }
190
        if (!empty($searchData['birth_end']) && $searchData['birth_end']) {
191
            $date = clone $searchData['birth_end'];
192
            $date->modify('+1 days');
193
            $qb
194
                ->andWhere('c.birth < :birth_end')
195
                ->setParameter('birth_end', $date);
196
        }
197
198
        // tel
199
        if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) {
@@ 235-241 (lines=7) @@
232
                ->andWhere('c.create_date >= :create_date_start')
233
                ->setParameter('create_date_start', $searchData['create_date_start']);
234
        }
235
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
236
            $date = clone $searchData['create_date_end'];
237
            $date->modify('+1 days');
238
            $qb
239
                ->andWhere('c.create_date < :create_date_end')
240
                ->setParameter('create_date_end', $date);
241
        }
242
243
        // update_date
244
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 249-255 (lines=7) @@
246
                ->andWhere('c.update_date >= :update_date_start')
247
                ->setParameter('update_date_start', $searchData['update_date_start']);
248
        }
249
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
250
            $date = clone $searchData['update_date_end'];
251
            $date->modify('+1 days');
252
            $qb
253
                ->andWhere('c.update_date < :update_date_end')
254
                ->setParameter('update_date_end', $date);
255
        }
256
257
        // last_buy
258
        if (!empty($searchData['last_buy_start']) && $searchData['last_buy_start']) {
@@ 263-269 (lines=7) @@
260
                ->andWhere('c.last_buy_date >= :last_buy_start')
261
                ->setParameter('last_buy_start', $searchData['last_buy_start']);
262
        }
263
        if (!empty($searchData['last_buy_end']) && $searchData['last_buy_end']) {
264
            $date = clone $searchData['last_buy_end'];
265
            $date->modify('+1 days');
266
            $qb
267
                ->andWhere('c.last_buy_date < :last_buy_end')
268
                ->setParameter('last_buy_end', $date);
269
        }
270
271
        // status
272
        if (!empty($searchData['customer_status']) && count($searchData['customer_status']) > 0) {

src/Eccube/Repository/OrderRepository.php 14 locations

@@ 85-89 (lines=5) @@
82
        }
83
84
        // status
85
        if (!empty($searchData['status']) && $searchData['status']) {
86
            $qb
87
                ->andWhere('o.OrderStatus = :status')
88
                ->setParameter('status', $searchData['status']);
89
        }
90
91
        // name
92
        if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) {
@@ 185-190 (lines=6) @@
182
        }
183
184
        // oreder_date
185
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
186
            $date = $searchData['order_date_start'];
187
            $qb
188
                ->andWhere('o.create_date >= :order_date_start')
189
                ->setParameter('order_date_start', $date);
190
        }
191
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
192
            $date = clone $searchData['order_date_end'];
193
            $date = $date
@@ 277-282 (lines=6) @@
274
275
        // status
276
        $filterStatus = false;
277
        if (!empty($searchData['status']) && $searchData['status']) {
278
            $qb
279
                ->andWhere('o.OrderStatus = :status')
280
                ->setParameter('status', $searchData['status']);
281
            $filterStatus = true;
282
        }
283
        if (!empty($searchData['multi_status']) && count($searchData['multi_status'])) {
284
            $qb
285
                ->andWhere($qb->expr()->in('o.OrderStatus', ':multi_status'))
@@ 191-198 (lines=8) @@
188
                ->andWhere('o.create_date >= :order_date_start')
189
                ->setParameter('order_date_start', $date);
190
        }
191
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
192
            $date = clone $searchData['order_date_end'];
193
            $date = $date
194
                ->modify('+1 days');
195
            $qb
196
                ->andWhere('o.create_date < :order_date_end')
197
                ->setParameter('order_date_end', $date);
198
        }
199
200
        // create_date
201
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 201-206 (lines=6) @@
198
        }
199
200
        // create_date
201
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
202
            $date = $searchData['update_date_start'];
203
            $qb
204
                ->andWhere('o.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('o.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('o.update_date < :update_date_end')
213
                ->setParameter('update_date_end', $date);
214
        }
215
216
        // payment_total
217
        if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) {
@@ 346-351 (lines=6) @@
343
        }
344
345
        // oreder_date
346
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
347
            $date = $searchData['order_date_start'];
348
            $qb
349
                ->andWhere('o.order_date >= :order_date_start')
350
                ->setParameter('order_date_start', $date);
351
        }
352
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
353
            $date = clone $searchData['order_date_end'];
354
            $date = $date
@@ 352-359 (lines=8) @@
349
                ->andWhere('o.order_date >= :order_date_start')
350
                ->setParameter('order_date_start', $date);
351
        }
352
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
353
            $date = clone $searchData['order_date_end'];
354
            $date = $date
355
                ->modify('+1 days');
356
            $qb
357
                ->andWhere('o.order_date < :order_date_end')
358
                ->setParameter('order_date_end', $date);
359
        }
360
361
        // payment_date
362
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
@@ 362-367 (lines=6) @@
359
        }
360
361
        // payment_date
362
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
363
            $date = $searchData['payment_date_start'];
364
            $qb
365
                ->andWhere('o.payment_date >= :payment_date_start')
366
                ->setParameter('payment_date_start', $date);
367
        }
368
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
369
            $date = clone $searchData['payment_date_end'];
370
            $date = $date
@@ 368-375 (lines=8) @@
365
                ->andWhere('o.payment_date >= :payment_date_start')
366
                ->setParameter('payment_date_start', $date);
367
        }
368
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
369
            $date = clone $searchData['payment_date_end'];
370
            $date = $date
371
                ->modify('+1 days');
372
            $qb
373
                ->andWhere('o.payment_date < :payment_date_end')
374
                ->setParameter('payment_date_end', $date);
375
        }
376
377
        // commit_date
378
        if (!empty($searchData['commit_date_start']) && $searchData['commit_date_start']) {
@@ 378-383 (lines=6) @@
375
        }
376
377
        // commit_date
378
        if (!empty($searchData['commit_date_start']) && $searchData['commit_date_start']) {
379
            $date = $searchData['commit_date_start'];
380
            $qb
381
                ->andWhere('o.commit_date >= :commit_date_start')
382
                ->setParameter('commit_date_start', $date);
383
        }
384
        if (!empty($searchData['commit_date_end']) && $searchData['commit_date_end']) {
385
            $date = clone $searchData['commit_date_end'];
386
            $date = $date
@@ 384-391 (lines=8) @@
381
                ->andWhere('o.commit_date >= :commit_date_start')
382
                ->setParameter('commit_date_start', $date);
383
        }
384
        if (!empty($searchData['commit_date_end']) && $searchData['commit_date_end']) {
385
            $date = clone $searchData['commit_date_end'];
386
            $date = $date
387
                ->modify('+1 days');
388
            $qb
389
                ->andWhere('o.commit_date < :commit_date_end')
390
                ->setParameter('commit_date_end', $date);
391
        }
392
393
394
        // update_date
@@ 395-400 (lines=6) @@
392
393
394
        // update_date
395
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
396
            $date = $searchData['update_date_start'];
397
            $qb
398
                ->andWhere('o.update_date >= :update_date_start')
399
                ->setParameter('update_date_start', $date);
400
        }
401
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
402
            $date = clone $searchData['update_date_end'];
403
            $date = $date
@@ 401-408 (lines=8) @@
398
                ->andWhere('o.update_date >= :update_date_start')
399
                ->setParameter('update_date_start', $date);
400
        }
401
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
402
            $date = clone $searchData['update_date_end'];
403
            $date = $date
404
                ->modify('+1 days');
405
            $qb
406
                ->andWhere('o.update_date < :update_date_end')
407
                ->setParameter('update_date_end', $date);
408
        }
409
410
        // payment_total
411
        if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) {

src/Eccube/Repository/ProductRepository.php 2 locations

@@ 238-243 (lines=6) @@
235
        }
236
237
        // update_date
238
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
239
            $date = $searchData['update_date_start'];
240
            $qb
241
                ->andWhere('p.update_date >= :update_date_start')
242
                ->setParameter('update_date_start', $date);
243
        }
244
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
245
            $date = clone $searchData['update_date_end'];
246
            $date = $date
@@ 244-251 (lines=8) @@
241
                ->andWhere('p.update_date >= :update_date_start')
242
                ->setParameter('update_date_start', $date);
243
        }
244
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
245
            $date = clone $searchData['update_date_end'];
246
            $date = $date
247
                ->modify('+1 days');
248
            $qb
249
                ->andWhere('p.update_date < :update_date_end')
250
                ->setParameter('update_date_end', $date);
251
        }
252
253
254
        // Order By

src/Eccube/Repository/ShippingRepository.php 8 locations

@@ 117-122 (lines=6) @@
114
        }
115
116
        // oreder_date
117
        if (!empty($searchData['order_date_start']) && $searchData['order_date_start']) {
118
            $date = $searchData['order_date_start'];
119
            $qb
120
                ->andWhere('o.order_date >= :order_date_start')
121
                ->setParameter('order_date_start', $date);
122
        }
123
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
124
            $date = clone $searchData['order_date_end'];
125
            $date = $date
@@ 123-130 (lines=8) @@
120
                ->andWhere('o.order_date >= :order_date_start')
121
                ->setParameter('order_date_start', $date);
122
        }
123
        if (!empty($searchData['order_date_end']) && $searchData['order_date_end']) {
124
            $date = clone $searchData['order_date_end'];
125
            $date = $date
126
                ->modify('+1 days');
127
            $qb
128
                ->andWhere('o.order_date < :order_date_end')
129
                ->setParameter('order_date_end', $date);
130
        }
131
132
        // payment_date
133
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
@@ 133-138 (lines=6) @@
130
        }
131
132
        // payment_date
133
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
134
            $date = $searchData['payment_date_start'];
135
            $qb
136
                ->andWhere('o.payment_date >= :payment_date_start')
137
                ->setParameter('payment_date_start', $date);
138
        }
139
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
140
            $date = clone $searchData['payment_date_end'];
141
            $date = $date
@@ 139-146 (lines=8) @@
136
                ->andWhere('o.payment_date >= :payment_date_start')
137
                ->setParameter('payment_date_start', $date);
138
        }
139
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
140
            $date = clone $searchData['payment_date_end'];
141
            $date = $date
142
                ->modify('+1 days');
143
            $qb
144
                ->andWhere('o.payment_date < :payment_date_end')
145
                ->setParameter('payment_date_end', $date);
146
        }
147
148
        // commit_date
149
        if (!empty($searchData['commit_date_start']) && $searchData['commit_date_start']) {
@@ 149-154 (lines=6) @@
146
        }
147
148
        // commit_date
149
        if (!empty($searchData['commit_date_start']) && $searchData['commit_date_start']) {
150
            $date = $searchData['commit_date_start'];
151
            $qb
152
                ->andWhere('o.commit_date >= :commit_date_start')
153
                ->setParameter('commit_date_start', $date);
154
        }
155
        if (!empty($searchData['commit_date_end']) && $searchData['commit_date_end']) {
156
            $date = clone $searchData['commit_date_end'];
157
            $date = $date
@@ 155-162 (lines=8) @@
152
                ->andWhere('o.commit_date >= :commit_date_start')
153
                ->setParameter('commit_date_start', $date);
154
        }
155
        if (!empty($searchData['commit_date_end']) && $searchData['commit_date_end']) {
156
            $date = clone $searchData['commit_date_end'];
157
            $date = $date
158
                ->modify('+1 days');
159
            $qb
160
                ->andWhere('o.commit_date < :commit_date_end')
161
                ->setParameter('commit_date_end', $date);
162
        }
163
164
165
        // update_date
@@ 166-171 (lines=6) @@
163
164
165
        // update_date
166
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
167
            $date = $searchData['update_date_start'];
168
            $qb
169
                ->andWhere('o.update_date >= :update_date_start')
170
                ->setParameter('update_date_start', $date);
171
        }
172
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
173
            $date = clone $searchData['update_date_end'];
174
            $date = $date
@@ 172-179 (lines=8) @@
169
                ->andWhere('o.update_date >= :update_date_start')
170
                ->setParameter('update_date_start', $date);
171
        }
172
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
173
            $date = clone $searchData['update_date_end'];
174
            $date = $date
175
                ->modify('+1 days');
176
            $qb
177
                ->andWhere('o.update_date < :update_date_end')
178
                ->setParameter('update_date_end', $date);
179
        }
180
181
        // payment_total
182
        if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) {