Code Duplication    Length = 6-8 lines in 24 locations

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

src/Eccube/Repository/OrderRepository.php 8 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.order_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.order_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.order_date < :order_date_end')
211
                ->setParameter('order_date_end', $date);
212
        }
213
214
        // payment_date
215
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
@@ 215-220 (lines=6) @@
212
        }
213
214
        // payment_date
215
        if (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) {
216
            $date = $searchData['payment_date_start'];
217
            $qb
218
                ->andWhere('o.payment_date >= :payment_date_start')
219
                ->setParameter('payment_date_start', $date);
220
        }
221
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
222
            $date = clone $searchData['payment_date_end'];
223
            $date = $date
@@ 221-228 (lines=8) @@
218
                ->andWhere('o.payment_date >= :payment_date_start')
219
                ->setParameter('payment_date_start', $date);
220
        }
221
        if (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) {
222
            $date = clone $searchData['payment_date_end'];
223
            $date = $date
224
                ->modify('+1 days');
225
            $qb
226
                ->andWhere('o.payment_date < :payment_date_end')
227
                ->setParameter('payment_date_end', $date);
228
        }
229
230
        // update_date
231
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 231-236 (lines=6) @@
228
        }
229
230
        // update_date
231
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
232
            $date = $searchData['update_date_start'];
233
            $qb
234
                ->andWhere('o.update_date >= :update_date_start')
235
                ->setParameter('update_date_start', $date);
236
        }
237
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
238
            $date = clone $searchData['update_date_end'];
239
            $date = $date
@@ 237-244 (lines=8) @@
234
                ->andWhere('o.update_date >= :update_date_start')
235
                ->setParameter('update_date_start', $date);
236
        }
237
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
238
            $date = clone $searchData['update_date_end'];
239
            $date = $date
240
                ->modify('+1 days');
241
            $qb
242
                ->andWhere('o.update_date < :update_date_end')
243
                ->setParameter('update_date_end', $date);
244
        }
245
246
        // payment_total
247
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
@@ 290-295 (lines=6) @@
287
        }
288
289
        // お届け予定日(Shipping.delivery_date)
290
        if (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) {
291
            $date = $searchData['shipping_delivery_date_start'];
292
            $qb
293
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
294
                ->setParameter('shipping_delivery_date_start', $date);
295
        }
296
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
297
            $date = clone $searchData['shipping_delivery_date_end'];
298
            $date = $date
@@ 296-303 (lines=8) @@
293
                ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start')
294
                ->setParameter('shipping_delivery_date_start', $date);
295
        }
296
        if (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) {
297
            $date = clone $searchData['shipping_delivery_date_end'];
298
            $date = $date
299
                ->modify('+1 days');
300
            $qb
301
                ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end')
302
                ->setParameter('shipping_delivery_date_end', $date);
303
        }
304
305
        // Order By
306
        $qb->orderBy('o.update_date', 'DESC');

src/Eccube/Repository/CustomerRepository.php 4 locations

@@ 145-151 (lines=7) @@
142
                ->andWhere('c.birth >= :birth_start')
143
                ->setParameter('birth_start', $searchData['birth_start']);
144
        }
145
        if (!empty($searchData['birth_end']) && $searchData['birth_end']) {
146
            $date = clone $searchData['birth_end'];
147
            $date->modify('+1 days');
148
            $qb
149
                ->andWhere('c.birth < :birth_end')
150
                ->setParameter('birth_end', $date);
151
        }
152
153
        // tel
154
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
@@ 191-197 (lines=7) @@
188
                ->andWhere('c.create_date >= :create_date_start')
189
                ->setParameter('create_date_start', $searchData['create_date_start']);
190
        }
191
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
192
            $date = clone $searchData['create_date_end'];
193
            $date->modify('+1 days');
194
            $qb
195
                ->andWhere('c.create_date < :create_date_end')
196
                ->setParameter('create_date_end', $date);
197
        }
198
199
        // update_date
200
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 205-211 (lines=7) @@
202
                ->andWhere('c.update_date >= :update_date_start')
203
                ->setParameter('update_date_start', $searchData['update_date_start']);
204
        }
205
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
206
            $date = clone $searchData['update_date_end'];
207
            $date->modify('+1 days');
208
            $qb
209
                ->andWhere('c.update_date < :update_date_end')
210
                ->setParameter('update_date_end', $date);
211
        }
212
213
        // last_buy
214
        if (!empty($searchData['last_buy_start']) && $searchData['last_buy_start']) {
@@ 219-225 (lines=7) @@
216
                ->andWhere('c.last_buy_date >= :last_buy_start')
217
                ->setParameter('last_buy_start', $searchData['last_buy_start']);
218
        }
219
        if (!empty($searchData['last_buy_end']) && $searchData['last_buy_end']) {
220
            $date = clone $searchData['last_buy_end'];
221
            $date->modify('+1 days');
222
            $qb
223
                ->andWhere('c.last_buy_date < :last_buy_end')
224
                ->setParameter('last_buy_end', $date);
225
        }
226
227
        // status
228
        if (!empty($searchData['customer_status']) && count($searchData['customer_status']) > 0) {

src/Eccube/Repository/ProductRepository.php 4 locations

@@ 302-307 (lines=6) @@
299
        }
300
301
        // crate_date
302
        if (!empty($searchData['create_date_start']) && $searchData['create_date_start']) {
303
            $date = $searchData['create_date_start'];
304
            $qb
305
                ->andWhere('p.create_date >= :create_date_start')
306
                ->setParameter('create_date_start', $date);
307
        }
308
309
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
310
            $date = clone $searchData['create_date_end'];
@@ 309-316 (lines=8) @@
306
                ->setParameter('create_date_start', $date);
307
        }
308
309
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
310
            $date = clone $searchData['create_date_end'];
311
            $date = $date
312
                ->modify('+1 days');
313
            $qb
314
                ->andWhere('p.create_date < :create_date_end')
315
                ->setParameter('create_date_end', $date);
316
        }
317
318
        // update_date
319
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 319-324 (lines=6) @@
316
        }
317
318
        // update_date
319
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
320
            $date = $searchData['update_date_start'];
321
            $qb
322
                ->andWhere('p.update_date >= :update_date_start')
323
                ->setParameter('update_date_start', $date);
324
        }
325
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
326
            $date = clone $searchData['update_date_end'];
327
            $date = $date
@@ 325-332 (lines=8) @@
322
                ->andWhere('p.update_date >= :update_date_start')
323
                ->setParameter('update_date_start', $date);
324
        }
325
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
326
            $date = clone $searchData['update_date_end'];
327
            $date = $date
328
                ->modify('+1 days');
329
            $qb
330
                ->andWhere('p.update_date < :update_date_end')
331
                ->setParameter('update_date_end', $date);
332
        }
333
334
        // Order By
335
        $qb