| @@ 88-92 (lines=5) @@ | ||
| 85 | $joinedCustomer = false; |
|
| 86 | ||
| 87 | // order_id_start |
|
| 88 | if (isset($searchData['order_id_start']) && Str::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']) && Str::isNotBlank($searchData['order_id_end'])) { |
|
| @@ 95-99 (lines=5) @@ | ||
| 92 | } |
|
| 93 | ||
| 94 | // order_id_end |
|
| 95 | if (isset($searchData['order_id_end']) && Str::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']) && Str::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']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 116-120 (lines=5) @@ | ||
| 113 | } |
|
| 114 | ||
| 115 | // kana |
|
| 116 | if (isset($searchData['kana']) && Str::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']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 123-127 (lines=5) @@ | ||
| 120 | } |
|
| 121 | ||
| 122 | ||
| 123 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('o.email = :email') |
|
| 126 | ->setParameter('email', $searchData['email']); |
|
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel01']) && Str::isNotBlank($searchData['tel01'])) { |
|
| @@ 130-134 (lines=5) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel01']) && Str::isNotBlank($searchData['tel01'])) { |
|
| 131 | $qb |
|
| 132 | ->andWhere('o.tel01 = :tel01') |
|
| 133 | ->setParameter('tel01', $searchData['tel01']); |
|
| 134 | } |
|
| 135 | if (isset($searchData['tel02']) && Str::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']) && Str::isNotBlank($searchData['tel02'])) { |
|
| 136 | $qb |
|
| 137 | ->andWhere('o.tel02 = :tel02') |
|
| 138 | ->setParameter('tel02', $searchData['tel02']); |
|
| 139 | } |
|
| 140 | if (isset($searchData['tel03']) && Str::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']) && Str::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']) && Str::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']) && Str::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']) && Str::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']) && Str::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']) && Str::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']) && Str::isNotBlank($searchData['multi'])) { |
|
| 277 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 286-290 (lines=5) @@ | ||
| 283 | } |
|
| 284 | ||
| 285 | // order_id_end |
|
| 286 | if (isset($searchData['order_id_end']) && Str::isNotBlank($searchData['order_id_end'])) { |
|
| 287 | $qb |
|
| 288 | ->andWhere('o.id <= :order_id_end') |
|
| 289 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 290 | } |
|
| 291 | ||
| 292 | // status |
|
| 293 | $filterStatus = false; |
|
| @@ 316-320 (lines=5) @@ | ||
| 313 | } |
|
| 314 | ||
| 315 | // name |
|
| 316 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| 317 | $qb |
|
| 318 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 319 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 320 | } |
|
| 321 | ||
| 322 | // kana |
|
| 323 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 323-327 (lines=5) @@ | ||
| 320 | } |
|
| 321 | ||
| 322 | // kana |
|
| 323 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| 324 | $qb |
|
| 325 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 326 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 327 | } |
|
| 328 | ||
| 329 | ||
| 330 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 330-334 (lines=5) @@ | ||
| 327 | } |
|
| 328 | ||
| 329 | ||
| 330 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 331 | $qb |
|
| 332 | ->andWhere('o.email like :email') |
|
| 333 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 334 | } |
|
| 335 | ||
| 336 | // tel |
|
| 337 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| @@ 337-341 (lines=5) @@ | ||
| 334 | } |
|
| 335 | ||
| 336 | // tel |
|
| 337 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 338 | $qb |
|
| 339 | ->andWhere('CONCAT(o.tel01, o.tel02, o.tel03) LIKE :tel') |
|
| 340 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 341 | } |
|
| 342 | ||
| 343 | // sex |
|
| 344 | if (!empty($searchData['sex']) && count($searchData['sex']) > 0) { |
|
| @@ 428-432 (lines=5) @@ | ||
| 425 | } |
|
| 426 | ||
| 427 | // payment_total |
|
| 428 | if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) { |
|
| 429 | $qb |
|
| 430 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 431 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 432 | } |
|
| 433 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 434 | $qb |
|
| 435 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 433-437 (lines=5) @@ | ||
| 430 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 431 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 432 | } |
|
| 433 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 434 | $qb |
|
| 435 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 436 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 437 | } |
|
| 438 | ||
| 439 | // buy_product_name |
|
| 440 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 52-56 (lines=5) @@ | ||
| 49 | $qb->leftJoin('s.ShipmentItems', 'si') |
|
| 50 | ->leftJoin('si.Order', 'o'); |
|
| 51 | // order_id_start |
|
| 52 | if (isset($searchData['shipping_id_start']) && Str::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']) && Str::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']) && Str::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']) && Str::isNotBlank($searchData['order_id'])) { |
|
| @@ 75-79 (lines=5) @@ | ||
| 72 | } |
|
| 73 | ||
| 74 | // order_id |
|
| 75 | if (isset($searchData['order_id']) && Str::isNotBlank($searchData['order_id'])) { |
|
| 76 | $qb |
|
| 77 | ->andWhere('o.id = :order_id') |
|
| 78 | ->setParameter('order_id', $searchData['order_id']); |
|
| 79 | } |
|
| 80 | ||
| 81 | // order status |
|
| 82 | if (isset($searchData['order_status']) && count($searchData['order_status'])) { |
|
| @@ 95-99 (lines=5) @@ | ||
| 92 | ->setParameter('shipping_status', $searchData['shipping_status']); |
|
| 93 | } |
|
| 94 | // name |
|
| 95 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| 96 | $qb |
|
| 97 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 98 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 99 | } |
|
| 100 | ||
| 101 | // kana |
|
| 102 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 102-106 (lines=5) @@ | ||
| 99 | } |
|
| 100 | ||
| 101 | // kana |
|
| 102 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| 103 | $qb |
|
| 104 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 105 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 106 | } |
|
| 107 | ||
| 108 | // order_name |
|
| 109 | if (isset($searchData['order_name']) && Str::isNotBlank($searchData['order_name'])) { |
|
| @@ 109-113 (lines=5) @@ | ||
| 106 | } |
|
| 107 | ||
| 108 | // order_name |
|
| 109 | if (isset($searchData['order_name']) && Str::isNotBlank($searchData['order_name'])) { |
|
| 110 | $qb |
|
| 111 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 112 | ->setParameter('order_name', '%' . $searchData['order_name'] . '%'); |
|
| 113 | } |
|
| 114 | ||
| 115 | // order_kana |
|
| 116 | if (isset($searchData['order_kana']) && Str::isNotBlank($searchData['order_kana'])) { |
|
| @@ 116-120 (lines=5) @@ | ||
| 113 | } |
|
| 114 | ||
| 115 | // order_kana |
|
| 116 | if (isset($searchData['order_kana']) && Str::isNotBlank($searchData['order_kana'])) { |
|
| 117 | $qb |
|
| 118 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 119 | ->setParameter('kana', '%' . $searchData['order_kana'] . '%'); |
|
| 120 | } |
|
| 121 | ||
| 122 | // order_email |
|
| 123 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 123-127 (lines=5) @@ | ||
| 120 | } |
|
| 121 | ||
| 122 | // order_email |
|
| 123 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('o.email like :email') |
|
| 126 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| @@ 130-134 (lines=5) @@ | ||
| 127 | } |
|
| 128 | ||
| 129 | // tel |
|
| 130 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 131 | $qb |
|
| 132 | ->andWhere('CONCAT(s.tel01, s.tel02, s.tel03) LIKE :tel') |
|
| 133 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 134 | } |
|
| 135 | ||
| 136 | // payment |
|
| 137 | if (!empty($searchData['payment']) && count($searchData['payment'])) { |
|
| @@ 214-218 (lines=5) @@ | ||
| 211 | } |
|
| 212 | ||
| 213 | // payment_total |
|
| 214 | if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) { |
|
| 215 | $qb |
|
| 216 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 217 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 218 | } |
|
| 219 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 220 | $qb |
|
| 221 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 219-223 (lines=5) @@ | ||
| 216 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 217 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 218 | } |
|
| 219 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 220 | $qb |
|
| 221 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 222 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 223 | } |
|
| 224 | ||
| 225 | // buy_product_name |
|
| 226 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 226-230 (lines=5) @@ | ||
| 223 | } |
|
| 224 | ||
| 225 | // buy_product_name |
|
| 226 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| 227 | $qb |
|
| 228 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 229 | ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
| 230 | } |
|
| 231 | ||
| 232 | // Order By |
|
| 233 | $qb->orderBy('s.update_date', 'DESC'); |
|
| @@ 221-225 (lines=5) @@ | ||
| 218 | } |
|
| 219 | ||
| 220 | // tel |
|
| 221 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 222 | $qb |
|
| 223 | ->andWhere('CONCAT(c.tel01, c.tel02, c.tel03) LIKE :tel') |
|
| 224 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 225 | } |
|
| 226 | ||
| 227 | // buy_total |
|
| 228 | if (isset($searchData['buy_total_start']) && Str::isNotBlank($searchData['buy_total_start'])) { |
|
| @@ 228-232 (lines=5) @@ | ||
| 225 | } |
|
| 226 | ||
| 227 | // buy_total |
|
| 228 | if (isset($searchData['buy_total_start']) && Str::isNotBlank($searchData['buy_total_start'])) { |
|
| 229 | $qb |
|
| 230 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 231 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 232 | } |
|
| 233 | if (isset($searchData['buy_total_end']) && Str::isNotBlank($searchData['buy_total_end'])) { |
|
| 234 | $qb |
|
| 235 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| @@ 233-237 (lines=5) @@ | ||
| 230 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 231 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 232 | } |
|
| 233 | if (isset($searchData['buy_total_end']) && Str::isNotBlank($searchData['buy_total_end'])) { |
|
| 234 | $qb |
|
| 235 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| 236 | ->setParameter('buy_total_end', $searchData['buy_total_end']); |
|
| 237 | } |
|
| 238 | ||
| 239 | // buy_times |
|
| 240 | if (!empty($searchData['buy_times_start']) && $searchData['buy_times_start']) { |
|