Code Duplication    Length = 6-7 lines in 3 locations

src/Eccube/Repository/CustomerRepository.php 1 location

@@ 236-242 (lines=7) @@
233
        }
234
235
        // buy_product_name
236
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
237
            $qb
238
                ->leftJoin('c.Orders', 'o')
239
                ->leftJoin('o.OrderItems', 'oi')
240
                ->andWhere('oi.product_name LIKE :buy_product_name')
241
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
242
        }
243
244
        // Order By
245
        $qb->addOrderBy('c.update_date', 'DESC');

src/Eccube/Repository/OrderRepository.php 2 locations

@@ 233-238 (lines=6) @@
230
        }
231
232
        // buy_product_name
233
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
234
            $qb
235
                ->leftJoin('o.OrderItems', 'oi')
236
                ->andWhere('oi.product_name LIKE :buy_product_name')
237
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
238
        }
239
240
        // Order By
241
        $qb->addOrderBy('o.update_date', 'DESC');
@@ 443-448 (lines=6) @@
440
        }
441
442
        // buy_product_name
443
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
444
            $qb
445
                ->leftJoin('o.OrderItems', 'oi')
446
                ->andWhere('oi.product_name LIKE :buy_product_name')
447
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
448
        }
449
450
        // Order By
451
        $qb->orderBy('o.update_date', 'DESC');