Code Duplication    Length = 5-5 lines in 31 locations

src/Eccube/Repository/CustomerRepository.php 2 locations

@@ 163-167 (lines=5) @@
160
        }
161
162
        // buy_total
163
        if (isset($searchData['buy_total_start']) && StringUtil::isNotBlank($searchData['buy_total_start'])) {
164
            $qb
165
                ->andWhere('c.buy_total >= :buy_total_start')
166
                ->setParameter('buy_total_start', $searchData['buy_total_start']);
167
        }
168
        if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) {
169
            $qb
170
                ->andWhere('c.buy_total <= :buy_total_end')
@@ 168-172 (lines=5) @@
165
                ->andWhere('c.buy_total >= :buy_total_start')
166
                ->setParameter('buy_total_start', $searchData['buy_total_start']);
167
        }
168
        if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) {
169
            $qb
170
                ->andWhere('c.buy_total <= :buy_total_end')
171
                ->setParameter('buy_total_end', $searchData['buy_total_end']);
172
        }
173
174
        // buy_times
175
        if (!empty($searchData['buy_times_start']) && $searchData['buy_times_start']) {

src/Eccube/Repository/OrderRepository.php 18 locations

@@ 85-89 (lines=5) @@
82
        $joinedCustomer = false;
83
84
        // order_id_start
85
        if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) {
86
            $qb
87
                ->andWhere('o.id >= :order_id_start')
88
                ->setParameter('order_id_start', $searchData['order_id_start']);
89
        }
90
91
        // order_id_end
92
        if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) {
@@ 92-96 (lines=5) @@
89
        }
90
91
        // order_id_end
92
        if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) {
93
            $qb
94
                ->andWhere('o.id <= :order_id_end')
95
                ->setParameter('order_id_end', $searchData['order_id_end']);
96
        }
97
98
        // status
99
        if (!empty($searchData['status']) && $searchData['status']) {
@@ 106-110 (lines=5) @@
103
        }
104
105
        // name
106
        if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) {
107
            $qb
108
                ->andWhere('CONCAT(o.name01, o.name02) LIKE :name')
109
                ->setParameter('name', '%'.$searchData['name'].'%');
110
        }
111
112
        // kana
113
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
@@ 113-117 (lines=5) @@
110
        }
111
112
        // kana
113
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
114
            $qb
115
                ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana')
116
                ->setParameter('kana', '%'.$searchData['kana'].'%');
117
        }
118
119
        // email
120
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
@@ 120-124 (lines=5) @@
117
        }
118
119
        // email
120
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
121
            $qb
122
                ->andWhere('o.email = :email')
123
                ->setParameter('email', $searchData['email']);
124
        }
125
126
        // tel
127
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
@@ 127-131 (lines=5) @@
124
        }
125
126
        // tel
127
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
128
            $qb
129
                ->andWhere('o.phone_number = :phone_number')
130
                ->setParameter('phone_number', $searchData['phone_number']);
131
        }
132
133
        // birth
134
        if (!empty($searchData['birth_start']) && $searchData['birth_start']) {
@@ 221-225 (lines=5) @@
218
        }
219
220
        // payment_total
221
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
222
            $qb
223
                ->andWhere('o.payment_total >= :payment_total_start')
224
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
225
        }
226
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
227
            $qb
228
                ->andWhere('o.payment_total <= :payment_total_end')
@@ 226-230 (lines=5) @@
223
                ->andWhere('o.payment_total >= :payment_total_start')
224
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
225
        }
226
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
227
            $qb
228
                ->andWhere('o.payment_total <= :payment_total_end')
229
                ->setParameter('payment_total_end', $searchData['payment_total_end']);
230
        }
231
232
        // buy_product_name
233
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
@@ 258-262 (lines=5) @@
255
            ->innerJoin('o.Shippings', 's');
256
257
        // order_id_start
258
        if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) {
259
            $qb
260
                ->andWhere('o.id = :order_id')
261
                ->setParameter('order_id', $searchData['order_id']);
262
        }
263
264
        // order_no
265
        if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) {
@@ 265-269 (lines=5) @@
262
        }
263
264
        // order_no
265
        if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) {
266
            $qb
267
                ->andWhere('o.order_no = :order_no')
268
                ->setParameter('order_no', $searchData['order_no']);
269
        }
270
271
        // order_id_start
272
        if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) {
@@ 272-276 (lines=5) @@
269
        }
270
271
        // order_id_start
272
        if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) {
273
            $qb
274
                ->andWhere('o.id >= :order_id_start')
275
                ->setParameter('order_id_start', $searchData['order_id_start']);
276
        }
277
        // multi
278
        if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) {
279
            $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null;
@@ 289-293 (lines=5) @@
286
        }
287
288
        // order_id_end
289
        if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) {
290
            $qb
291
                ->andWhere('o.id <= :order_id_end')
292
                ->setParameter('order_id_end', $searchData['order_id_end']);
293
        }
294
295
        // status
296
        $filterStatus = false;
@@ 314-318 (lines=5) @@
311
        }
312
313
        // company_name
314
        if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) {
315
            $qb
316
                ->andWhere('o.company_name LIKE :company_name')
317
                ->setParameter('company_name', '%'.$searchData['company_name'].'%');
318
        }
319
320
        // name
321
        if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) {
@@ 321-325 (lines=5) @@
318
        }
319
320
        // name
321
        if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) {
322
            $qb
323
                ->andWhere('CONCAT(o.name01, o.name02) LIKE :name')
324
                ->setParameter('name', '%'.$searchData['name'].'%');
325
        }
326
327
        // kana
328
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
@@ 328-332 (lines=5) @@
325
        }
326
327
        // kana
328
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
329
            $qb
330
                ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana')
331
                ->setParameter('kana', '%'.$searchData['kana'].'%');
332
        }
333
334
        // email
335
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
@@ 335-339 (lines=5) @@
332
        }
333
334
        // email
335
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
336
            $qb
337
                ->andWhere('o.email like :email')
338
                ->setParameter('email', '%'.$searchData['email'].'%');
339
        }
340
341
        // tel
342
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
@@ 417-421 (lines=5) @@
414
        }
415
416
        // payment_total
417
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
418
            $qb
419
                ->andWhere('o.payment_total >= :payment_total_start')
420
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
421
        }
422
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
423
            $qb
424
                ->andWhere('o.payment_total <= :payment_total_end')
@@ 422-426 (lines=5) @@
419
                ->andWhere('o.payment_total >= :payment_total_start')
420
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
421
        }
422
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
423
            $qb
424
                ->andWhere('o.payment_total <= :payment_total_end')
425
                ->setParameter('payment_total_end', $searchData['payment_total_end']);
426
        }
427
428
        // buy_product_name
429
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {

src/Eccube/Repository/ShippingRepository.php 11 locations

@@ 48-52 (lines=5) @@
45
        $qb->leftJoin('s.OrderItems', 'si')
46
            ->leftJoin('si.Order', 'o');
47
        // order_id_start
48
        if (isset($searchData['shipping_id_start']) && StringUtil::isNotBlank($searchData['shipping_id_start'])) {
49
            $qb
50
                ->andWhere('s.id >= :shipping_id_start')
51
                ->setParameter('shipping_id_start', $searchData['shipping_id_start']);
52
        }
53
        // multi
54
        if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) {
55
            $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null;
@@ 64-68 (lines=5) @@
61
        }
62
63
        // shipping_id_end
64
        if (isset($searchData['shipping_id_end']) && StringUtil::isNotBlank($searchData['shipping_id_end'])) {
65
            $qb
66
                ->andWhere('s.id <= :shipping_id_end')
67
                ->setParameter('shipping_id_end', $searchData['shipping_id_end']);
68
        }
69
70
        // order_id
71
        if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) {
@@ 71-75 (lines=5) @@
68
        }
69
70
        // order_id
71
        if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) {
72
            $qb
73
                ->andWhere('o.id = :order_id')
74
                ->setParameter('order_id', $searchData['order_id']);
75
        }
76
77
        // order_no
78
        if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) {
@@ 98-102 (lines=5) @@
95
                ->setParameter('shipping_status', $searchData['shipping_status']);
96
        }
97
        // name
98
        if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) {
99
            $qb
100
                ->andWhere('CONCAT(s.name01, s.name02) LIKE :name')
101
                ->setParameter('name', '%'.$searchData['name'].'%');
102
        }
103
104
        // kana
105
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
@@ 105-109 (lines=5) @@
102
        }
103
104
        // kana
105
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
106
            $qb
107
                ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana')
108
                ->setParameter('kana', '%'.$searchData['kana'].'%');
109
        }
110
111
        // order_name
112
        if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) {
@@ 112-116 (lines=5) @@
109
        }
110
111
        // order_name
112
        if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) {
113
            $qb
114
                ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name')
115
                ->setParameter('order_name', '%'.$searchData['order_name'].'%');
116
        }
117
118
        // order_kana
119
        if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) {
@@ 119-123 (lines=5) @@
116
        }
117
118
        // order_kana
119
        if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) {
120
            $qb
121
                ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana')
122
                ->setParameter('order_kana', '%'.$searchData['order_kana'].'%');
123
        }
124
125
        // order_email
126
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
@@ 126-130 (lines=5) @@
123
        }
124
125
        // order_email
126
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
127
            $qb
128
                ->andWhere('o.email like :email')
129
                ->setParameter('email', '%'.$searchData['email'].'%');
130
        }
131
132
        // tel
133
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
@@ 217-221 (lines=5) @@
214
        }
215
216
        // payment_total
217
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
218
            $qb
219
                ->andWhere('o.payment_total >= :payment_total_start')
220
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
221
        }
222
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
223
            $qb
224
                ->andWhere('o.payment_total <= :payment_total_end')
@@ 222-226 (lines=5) @@
219
                ->andWhere('o.payment_total >= :payment_total_start')
220
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
221
        }
222
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
223
            $qb
224
                ->andWhere('o.payment_total <= :payment_total_end')
225
                ->setParameter('payment_total_end', $searchData['payment_total_end']);
226
        }
227
228
        // buy_product_name
229
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
@@ 229-233 (lines=5) @@
226
        }
227
228
        // buy_product_name
229
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
230
            $qb
231
                ->andWhere('si.product_name LIKE :buy_product_name')
232
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
233
        }
234
235
        // Order By
236
        $qb->orderBy('s.update_date', 'DESC');