Code Duplication    Length = 5-7 lines in 7 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 3 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'))