Code Duplication    Length = 5-5 lines in 31 locations

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'])) {
@@ 92-96 (lines=5) @@
89
                ->setParameter('order_status', $searchData['order_status']);
90
        }
91
        // name
92
        if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) {
93
            $qb
94
                ->andWhere('CONCAT(s.name01, s.name02) LIKE :name')
95
                ->setParameter('name', '%'.$searchData['name'].'%');
96
        }
97
98
        // kana
99
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
@@ 99-103 (lines=5) @@
96
        }
97
98
        // kana
99
        if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) {
100
            $qb
101
                ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana')
102
                ->setParameter('kana', '%'.$searchData['kana'].'%');
103
        }
104
105
        // order_name
106
        if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) {
@@ 106-110 (lines=5) @@
103
        }
104
105
        // order_name
106
        if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) {
107
            $qb
108
                ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name')
109
                ->setParameter('order_name', '%'.$searchData['order_name'].'%');
110
        }
111
112
        // order_kana
113
        if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) {
@@ 113-117 (lines=5) @@
110
        }
111
112
        // order_kana
113
        if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) {
114
            $qb
115
                ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana')
116
                ->setParameter('order_kana', '%'.$searchData['order_kana'].'%');
117
        }
118
119
        // order_email
120
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
@@ 120-124 (lines=5) @@
117
        }
118
119
        // order_email
120
        if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) {
121
            $qb
122
                ->andWhere('o.email like :email')
123
                ->setParameter('email', '%'.$searchData['email'].'%');
124
        }
125
126
        // tel
127
        if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) {
@@ 211-215 (lines=5) @@
208
        }
209
210
        // payment_total
211
        if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) {
212
            $qb
213
                ->andWhere('o.payment_total >= :payment_total_start')
214
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
215
        }
216
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
217
            $qb
218
                ->andWhere('o.payment_total <= :payment_total_end')
@@ 216-220 (lines=5) @@
213
                ->andWhere('o.payment_total >= :payment_total_start')
214
                ->setParameter('payment_total_start', $searchData['payment_total_start']);
215
        }
216
        if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) {
217
            $qb
218
                ->andWhere('o.payment_total <= :payment_total_end')
219
                ->setParameter('payment_total_end', $searchData['payment_total_end']);
220
        }
221
222
        // buy_product_name
223
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
@@ 223-227 (lines=5) @@
220
        }
221
222
        // buy_product_name
223
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
224
            $qb
225
                ->andWhere('si.product_name LIKE :buy_product_name')
226
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
227
        }
228
229
        // Order By
230
        $qb->orderBy('s.update_date', 'DESC');

src/Eccube/Repository/CustomerRepository.php 2 locations

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