Code Duplication    Length = 6-8 lines in 24 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/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/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/ProductRepository.php 4 locations

@@ 264-269 (lines=6) @@
261
        }
262
263
        // crate_date
264
        if (!empty($searchData['create_date_start']) && $searchData['create_date_start']) {
265
            $date = $searchData['create_date_start'];
266
            $qb
267
                ->andWhere('p.create_date >= :create_date_start')
268
                ->setParameter('create_date_start', $date);
269
        }
270
271
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
272
            $date = clone $searchData['create_date_end'];
@@ 271-278 (lines=8) @@
268
                ->setParameter('create_date_start', $date);
269
        }
270
271
        if (!empty($searchData['create_date_end']) && $searchData['create_date_end']) {
272
            $date = clone $searchData['create_date_end'];
273
            $date = $date
274
                ->modify('+1 days');
275
            $qb
276
                ->andWhere('p.create_date < :create_date_end')
277
                ->setParameter('create_date_end', $date);
278
        }
279
280
        // update_date
281
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
@@ 281-286 (lines=6) @@
278
        }
279
280
        // update_date
281
        if (!empty($searchData['update_date_start']) && $searchData['update_date_start']) {
282
            $date = $searchData['update_date_start'];
283
            $qb
284
                ->andWhere('p.update_date >= :update_date_start')
285
                ->setParameter('update_date_start', $date);
286
        }
287
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
288
            $date = clone $searchData['update_date_end'];
289
            $date = $date
@@ 287-294 (lines=8) @@
284
                ->andWhere('p.update_date >= :update_date_start')
285
                ->setParameter('update_date_start', $date);
286
        }
287
        if (!empty($searchData['update_date_end']) && $searchData['update_date_end']) {
288
            $date = clone $searchData['update_date_end'];
289
            $date = $date
290
                ->modify('+1 days');
291
            $qb
292
                ->andWhere('p.update_date < :update_date_end')
293
                ->setParameter('update_date_end', $date);
294
        }
295
296
        // Order By
297
        $qb