Code Duplication    Length = 6-7 lines in 3 locations

src/Eccube/Repository/CustomerRepository.php 1 location

@@ 279-285 (lines=7) @@
276
        }
277
278
        // buy_product_name态buy_product_code
279
        if (isset($searchData['buy_product_code']) && Str::isNotBlank($searchData['buy_product_code'])) {
280
            $qb
281
                ->leftJoin('c.Orders', 'o')
282
                ->leftJoin('o.OrderDetails', 'od')
283
                ->andWhere('od.product_name LIKE :buy_product_name OR od.product_code LIKE :buy_product_name')
284
                ->setParameter('buy_product_name', '%' . $searchData['buy_product_code'] . '%');
285
        }
286
287
        // Order By
288
        $qb->addOrderBy('c.update_date', 'DESC');

src/Eccube/Repository/OrderRepository.php 2 locations

@@ 229-234 (lines=6) @@
226
        }
227
228
        // buy_product_name
229
        if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) {
230
            $qb
231
                ->leftJoin('o.OrderDetails', 'od')
232
                ->andWhere('od.product_name LIKE :buy_product_name')
233
                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
234
        }
235
236
        // Order By
237
        $qb->addOrderBy('o.update_date', 'DESC');
@@ 423-428 (lines=6) @@
420
        }
421
422
        // buy_product_name
423
        if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) {
424
            $qb
425
                ->leftJoin('o.OrderDetails', 'od')
426
                ->andWhere('od.product_name LIKE :buy_product_name')
427
                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
428
        }
429
430
        // Order By
431
        $qb->orderBy('o.update_date', 'DESC');