| @@ 88-92 (lines=5) @@ | ||
| 85 | $joinedCustomer = false; |
|
| 86 | ||
| 87 | // order_id_start |
|
| 88 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 89 | $qb |
|
| 90 | ->andWhere('o.id >= :order_id_start') |
|
| 91 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 92 | } |
|
| 93 | ||
| 94 | // order_id_end |
|
| 95 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| @@ 95-99 (lines=5) @@ | ||
| 92 | } |
|
| 93 | ||
| 94 | // order_id_end |
|
| 95 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 96 | $qb |
|
| 97 | ->andWhere('o.id <= :order_id_end') |
|
| 98 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 99 | } |
|
| 100 | ||
| 101 | // status |
|
| 102 | if (!empty($searchData['status']) && $searchData['status']) { |
|
| @@ 109-113 (lines=5) @@ | ||
| 106 | } |
|
| 107 | ||
| 108 | // name |
|
| 109 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 110 | $qb |
|
| 111 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 112 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 113 | } |
|
| 114 | ||
| 115 | // kana |
|
| 116 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 116-120 (lines=5) @@ | ||
| 113 | } |
|
| 114 | ||
| 115 | // kana |
|
| 116 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 117 | $qb |
|
| 118 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 119 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 120 | } |
|
| 121 | ||
| 122 | ||
| 123 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 123-127 (lines=5) @@ | ||
| 120 | } |
|
| 121 | ||
| 122 | ||
| 123 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('o.email = :email') |
|
| 126 | ->setParameter('email', $searchData['email']); |
|
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel01']) && StringUtil::isNotBlank($searchData['tel01'])) { |
|
| @@ 130-134 (lines=5) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel01']) && StringUtil::isNotBlank($searchData['tel01'])) { |
|
| 131 | $qb |
|
| 132 | ->andWhere('o.tel01 = :tel01') |
|
| 133 | ->setParameter('tel01', $searchData['tel01']); |
|
| 134 | } |
|
| 135 | if (isset($searchData['tel02']) && StringUtil::isNotBlank($searchData['tel02'])) { |
|
| 136 | $qb |
|
| 137 | ->andWhere('o.tel02 = :tel02') |
|
| @@ 135-139 (lines=5) @@ | ||
| 132 | ->andWhere('o.tel01 = :tel01') |
|
| 133 | ->setParameter('tel01', $searchData['tel01']); |
|
| 134 | } |
|
| 135 | if (isset($searchData['tel02']) && StringUtil::isNotBlank($searchData['tel02'])) { |
|
| 136 | $qb |
|
| 137 | ->andWhere('o.tel02 = :tel02') |
|
| 138 | ->setParameter('tel02', $searchData['tel02']); |
|
| 139 | } |
|
| 140 | if (isset($searchData['tel03']) && StringUtil::isNotBlank($searchData['tel03'])) { |
|
| 141 | $qb |
|
| 142 | ->andWhere('o.tel03 = :tel03') |
|
| @@ 140-144 (lines=5) @@ | ||
| 137 | ->andWhere('o.tel02 = :tel02') |
|
| 138 | ->setParameter('tel02', $searchData['tel02']); |
|
| 139 | } |
|
| 140 | if (isset($searchData['tel03']) && StringUtil::isNotBlank($searchData['tel03'])) { |
|
| 141 | $qb |
|
| 142 | ->andWhere('o.tel03 = :tel03') |
|
| 143 | ->setParameter('tel03', $searchData['tel03']); |
|
| 144 | } |
|
| 145 | ||
| 146 | // birth |
|
| 147 | if (!empty($searchData['birth_start']) && $searchData['birth_start']) { |
|
| @@ 234-238 (lines=5) @@ | ||
| 231 | } |
|
| 232 | ||
| 233 | // payment_total |
|
| 234 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 235 | $qb |
|
| 236 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 237 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 238 | } |
|
| 239 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 240 | $qb |
|
| 241 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 239-243 (lines=5) @@ | ||
| 236 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 237 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 238 | } |
|
| 239 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 240 | $qb |
|
| 241 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 242 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 243 | } |
|
| 244 | ||
| 245 | // buy_product_name |
|
| 246 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 270-274 (lines=5) @@ | ||
| 267 | $qb = $this->createQueryBuilder('o'); |
|
| 268 | ||
| 269 | // order_id_start |
|
| 270 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 271 | $qb |
|
| 272 | ->andWhere('o.id >= :order_id_start') |
|
| 273 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 274 | } |
|
| 275 | // multi |
|
| 276 | if (isset( $searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 277 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 287-291 (lines=5) @@ | ||
| 284 | } |
|
| 285 | ||
| 286 | // order_id_end |
|
| 287 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 288 | $qb |
|
| 289 | ->andWhere('o.id <= :order_id_end') |
|
| 290 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 291 | } |
|
| 292 | ||
| 293 | // status |
|
| 294 | $filterStatus = false; |
|
| @@ 317-321 (lines=5) @@ | ||
| 314 | } |
|
| 315 | ||
| 316 | // name |
|
| 317 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 318 | $qb |
|
| 319 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 320 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 321 | } |
|
| 322 | ||
| 323 | // kana |
|
| 324 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 324-328 (lines=5) @@ | ||
| 321 | } |
|
| 322 | ||
| 323 | // kana |
|
| 324 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 325 | $qb |
|
| 326 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 327 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 328 | } |
|
| 329 | ||
| 330 | ||
| 331 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 331-335 (lines=5) @@ | ||
| 328 | } |
|
| 329 | ||
| 330 | ||
| 331 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 332 | $qb |
|
| 333 | ->andWhere('o.email like :email') |
|
| 334 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 335 | } |
|
| 336 | ||
| 337 | // tel |
|
| 338 | if (isset($searchData['tel']) && StringUtil::isNotBlank($searchData['tel'])) { |
|
| @@ 430-434 (lines=5) @@ | ||
| 427 | } |
|
| 428 | ||
| 429 | // payment_total |
|
| 430 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 431 | $qb |
|
| 432 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 433 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 434 | } |
|
| 435 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 436 | $qb |
|
| 437 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 435-439 (lines=5) @@ | ||
| 432 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 433 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 434 | } |
|
| 435 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 436 | $qb |
|
| 437 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 438 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 439 | } |
|
| 440 | ||
| 441 | // buy_product_name |
|
| 442 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 52-56 (lines=5) @@ | ||
| 49 | $qb->leftJoin('s.OrderItems', 'si') |
|
| 50 | ->leftJoin('si.Order', 'o'); |
|
| 51 | // order_id_start |
|
| 52 | if (isset($searchData['shipping_id_start']) && StringUtil::isNotBlank($searchData['shipping_id_start'])) { |
|
| 53 | $qb |
|
| 54 | ->andWhere('s.id >= :shipping_id_start') |
|
| 55 | ->setParameter('shipping_id_start', $searchData['shipping_id_start']); |
|
| 56 | } |
|
| 57 | // multi |
|
| 58 | if (isset( $searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 59 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 68-72 (lines=5) @@ | ||
| 65 | } |
|
| 66 | ||
| 67 | // shipping_id_end |
|
| 68 | if (isset($searchData['shipping_id_end']) && StringUtil::isNotBlank($searchData['shipping_id_end'])) { |
|
| 69 | $qb |
|
| 70 | ->andWhere('s.id <= :shipping_id_end') |
|
| 71 | ->setParameter('shipping_id_end', $searchData['shipping_id_end']); |
|
| 72 | } |
|
| 73 | ||
| 74 | // order_id |
|
| 75 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| @@ 75-79 (lines=5) @@ | ||
| 72 | } |
|
| 73 | ||
| 74 | // order_id |
|
| 75 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 76 | $qb |
|
| 77 | ->andWhere('o.id = :order_id') |
|
| 78 | ->setParameter('order_id', $searchData['order_id']); |
|
| 79 | } |
|
| 80 | ||
| 81 | // order_code |
|
| 82 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| @@ 82-86 (lines=5) @@ | ||
| 79 | } |
|
| 80 | ||
| 81 | // order_code |
|
| 82 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| 83 | $qb |
|
| 84 | ->andWhere('o.code LIKE :order_code') |
|
| 85 | ->setParameter('order_code', "%{$searchData['order_code']}%"); |
|
| 86 | } |
|
| 87 | ||
| 88 | // order status |
|
| 89 | if (isset($searchData['order_status']) && count($searchData['order_status'])) { |
|
| @@ 102-106 (lines=5) @@ | ||
| 99 | ->setParameter('shipping_status', $searchData['shipping_status']); |
|
| 100 | } |
|
| 101 | // name |
|
| 102 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 103 | $qb |
|
| 104 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 105 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 106 | } |
|
| 107 | ||
| 108 | // kana |
|
| 109 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 109-113 (lines=5) @@ | ||
| 106 | } |
|
| 107 | ||
| 108 | // kana |
|
| 109 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 110 | $qb |
|
| 111 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 112 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 113 | } |
|
| 114 | ||
| 115 | // order_name |
|
| 116 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| @@ 116-120 (lines=5) @@ | ||
| 113 | } |
|
| 114 | ||
| 115 | // order_name |
|
| 116 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| 117 | $qb |
|
| 118 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 119 | ->setParameter('order_name', '%' . $searchData['order_name'] . '%'); |
|
| 120 | } |
|
| 121 | ||
| 122 | // order_kana |
|
| 123 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| @@ 123-127 (lines=5) @@ | ||
| 120 | } |
|
| 121 | ||
| 122 | // order_kana |
|
| 123 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 126 | ->setParameter('kana', '%' . $searchData['order_kana'] . '%'); |
|
| 127 | } |
|
| 128 | ||
| 129 | // order_email |
|
| 130 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 130-134 (lines=5) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // order_email |
|
| 130 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 131 | $qb |
|
| 132 | ->andWhere('o.email like :email') |
|
| 133 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 134 | } |
|
| 135 | ||
| 136 | // tel |
|
| 137 | if (isset($searchData['tel']) && StringUtil::isNotBlank($searchData['tel'])) { |
|
| @@ 222-226 (lines=5) @@ | ||
| 219 | } |
|
| 220 | ||
| 221 | // payment_total |
|
| 222 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 223 | $qb |
|
| 224 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 225 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 226 | } |
|
| 227 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 228 | $qb |
|
| 229 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 227-231 (lines=5) @@ | ||
| 224 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 225 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 226 | } |
|
| 227 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 228 | $qb |
|
| 229 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 230 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 231 | } |
|
| 232 | ||
| 233 | // buy_product_name |
|
| 234 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 234-238 (lines=5) @@ | ||
| 231 | } |
|
| 232 | ||
| 233 | // buy_product_name |
|
| 234 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 235 | $qb |
|
| 236 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 237 | ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
| 238 | } |
|
| 239 | ||
| 240 | // Order By |
|
| 241 | $qb->orderBy('s.update_date', 'DESC'); |
|
| @@ 220-224 (lines=5) @@ | ||
| 217 | } |
|
| 218 | ||
| 219 | // buy_total |
|
| 220 | if (isset($searchData['buy_total_start']) && StringUtil::isNotBlank($searchData['buy_total_start'])) { |
|
| 221 | $qb |
|
| 222 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 223 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 224 | } |
|
| 225 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 226 | $qb |
|
| 227 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| @@ 225-229 (lines=5) @@ | ||
| 222 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 223 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 224 | } |
|
| 225 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 226 | $qb |
|
| 227 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| 228 | ->setParameter('buy_total_end', $searchData['buy_total_end']); |
|
| 229 | } |
|
| 230 | ||
| 231 | // buy_times |
|
| 232 | if (!empty($searchData['buy_times_start']) && $searchData['buy_times_start']) { |
|