Code Duplication    Length = 6-7 lines in 3 locations

src/Eccube/Repository/OrderRepository.php 2 locations

@@ 243-248 (lines=6) @@
240
        }
241
242
        // buy_product_name
243
        if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) {
244
            $qb
245
                ->leftJoin('o.OrderDetails', 'od')
246
                ->andWhere('od.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');
@@ 445-450 (lines=6) @@
442
        }
443
444
        // buy_product_name
445
        if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) {
446
            $qb
447
                ->leftJoin('o.OrderDetails', 'od')
448
                ->andWhere('od.product_name LIKE :buy_product_name')
449
                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
450
        }
451
452
        // Order By
453
        $qb->orderBy('o.update_date', 'DESC');

src/Eccube/Repository/CustomerRepository.php 1 location

@@ 297-303 (lines=7) @@
294
        }
295
296
        // buy_product_name态buy_product_code
297
        if (isset($searchData['buy_product_code']) && Str::isNotBlank($searchData['buy_product_code'])) {
298
            $qb
299
                ->leftJoin('c.Orders', 'o')
300
                ->leftJoin('o.OrderDetails', 'od')
301
                ->andWhere('od.product_name LIKE :buy_product_name OR od.product_code LIKE :buy_product_name')
302
                ->setParameter('buy_product_name', '%' . $searchData['buy_product_code'] . '%');
303
        }
304
305
        // Order By
306
        $qb->addOrderBy('c.update_date', 'DESC');