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

@@ 243-248 (lines=6) @@
240
        }
241
242
        // buy_product_name
243
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
244
            $qb
245
                ->leftJoin('o.OrderItems', 'oi')
246
                ->andWhere('oi.product_name LIKE :buy_product_name')
247
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
248
        }
249
250
        // Order By
251
        $qb->addOrderBy('o.update_date', 'DESC');
@@ 453-458 (lines=6) @@
450
        }
451
452
        // buy_product_name
453
        if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) {
454
            $qb
455
                ->leftJoin('o.OrderItems', 'oi')
456
                ->andWhere('oi.product_name LIKE :buy_product_name')
457
                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
458
        }
459
460
        // Order By
461
        $qb->orderBy('o.update_date', 'DESC');