| @@ 199-203 (lines=5) @@ | ||
| 196 | } |
|
| 197 | ||
| 198 | // tel |
|
| 199 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 200 | $qb |
|
| 201 | ->andWhere('CONCAT(c.tel01, c.tel02, c.tel03) LIKE :tel') |
|
| 202 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 203 | } |
|
| 204 | ||
| 205 | // buy_total |
|
| 206 | if (isset($searchData['buy_total_start']) && Str::isNotBlank($searchData['buy_total_start'])) { |
|
| @@ 206-210 (lines=5) @@ | ||
| 203 | } |
|
| 204 | ||
| 205 | // buy_total |
|
| 206 | if (isset($searchData['buy_total_start']) && Str::isNotBlank($searchData['buy_total_start'])) { |
|
| 207 | $qb |
|
| 208 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 209 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 210 | } |
|
| 211 | if (isset($searchData['buy_total_end']) && Str::isNotBlank($searchData['buy_total_end'])) { |
|
| 212 | $qb |
|
| 213 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| @@ 211-215 (lines=5) @@ | ||
| 208 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 209 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 210 | } |
|
| 211 | if (isset($searchData['buy_total_end']) && Str::isNotBlank($searchData['buy_total_end'])) { |
|
| 212 | $qb |
|
| 213 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| 214 | ->setParameter('buy_total_end', $searchData['buy_total_end']); |
|
| 215 | } |
|
| 216 | ||
| 217 | // buy_times |
|
| 218 | if (!empty($searchData['buy_times_start']) && $searchData['buy_times_start']) { |
|
| @@ 71-75 (lines=5) @@ | ||
| 68 | $joinedCustomer = false; |
|
| 69 | ||
| 70 | // order_id_start |
|
| 71 | if (isset($searchData['order_id_start']) && Str::isNotBlank($searchData['order_id_start'])) { |
|
| 72 | $qb |
|
| 73 | ->andWhere('o.id >= :order_id_start') |
|
| 74 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 75 | } |
|
| 76 | ||
| 77 | // order_id_end |
|
| 78 | if (isset($searchData['order_id_end']) && Str::isNotBlank($searchData['order_id_end'])) { |
|
| @@ 78-82 (lines=5) @@ | ||
| 75 | } |
|
| 76 | ||
| 77 | // order_id_end |
|
| 78 | if (isset($searchData['order_id_end']) && Str::isNotBlank($searchData['order_id_end'])) { |
|
| 79 | $qb |
|
| 80 | ->andWhere('o.id <= :order_id_end') |
|
| 81 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 82 | } |
|
| 83 | ||
| 84 | // status |
|
| 85 | if (!empty($searchData['status']) && $searchData['status']) { |
|
| @@ 92-96 (lines=5) @@ | ||
| 89 | } |
|
| 90 | ||
| 91 | // name |
|
| 92 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| 93 | $qb |
|
| 94 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 95 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 96 | } |
|
| 97 | ||
| 98 | // kana |
|
| 99 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 99-103 (lines=5) @@ | ||
| 96 | } |
|
| 97 | ||
| 98 | // kana |
|
| 99 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| 100 | $qb |
|
| 101 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 102 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 103 | } |
|
| 104 | ||
| 105 | ||
| 106 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 106-110 (lines=5) @@ | ||
| 103 | } |
|
| 104 | ||
| 105 | ||
| 106 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 107 | $qb |
|
| 108 | ->andWhere('o.email = :email') |
|
| 109 | ->setParameter('email', $searchData['email']); |
|
| 110 | } |
|
| 111 | ||
| 112 | // tel |
|
| 113 | if (isset($searchData['tel01']) && Str::isNotBlank($searchData['tel01'])) { |
|
| @@ 113-117 (lines=5) @@ | ||
| 110 | } |
|
| 111 | ||
| 112 | // tel |
|
| 113 | if (isset($searchData['tel01']) && Str::isNotBlank($searchData['tel01'])) { |
|
| 114 | $qb |
|
| 115 | ->andWhere('o.tel01 = :tel01') |
|
| 116 | ->setParameter('tel01', $searchData['tel01']); |
|
| 117 | } |
|
| 118 | if (isset($searchData['tel02']) && Str::isNotBlank($searchData['tel02'])) { |
|
| 119 | $qb |
|
| 120 | ->andWhere('o.tel02 = :tel02') |
|
| @@ 118-122 (lines=5) @@ | ||
| 115 | ->andWhere('o.tel01 = :tel01') |
|
| 116 | ->setParameter('tel01', $searchData['tel01']); |
|
| 117 | } |
|
| 118 | if (isset($searchData['tel02']) && Str::isNotBlank($searchData['tel02'])) { |
|
| 119 | $qb |
|
| 120 | ->andWhere('o.tel02 = :tel02') |
|
| 121 | ->setParameter('tel02', $searchData['tel02']); |
|
| 122 | } |
|
| 123 | if (isset($searchData['tel03']) && Str::isNotBlank($searchData['tel03'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('o.tel03 = :tel03') |
|
| @@ 123-127 (lines=5) @@ | ||
| 120 | ->andWhere('o.tel02 = :tel02') |
|
| 121 | ->setParameter('tel02', $searchData['tel02']); |
|
| 122 | } |
|
| 123 | if (isset($searchData['tel03']) && Str::isNotBlank($searchData['tel03'])) { |
|
| 124 | $qb |
|
| 125 | ->andWhere('o.tel03 = :tel03') |
|
| 126 | ->setParameter('tel03', $searchData['tel03']); |
|
| 127 | } |
|
| 128 | ||
| 129 | // birth |
|
| 130 | if (!empty($searchData['birth_start']) && $searchData['birth_start']) { |
|
| @@ 217-221 (lines=5) @@ | ||
| 214 | } |
|
| 215 | ||
| 216 | // payment_total |
|
| 217 | if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) { |
|
| 218 | $qb |
|
| 219 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 220 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 221 | } |
|
| 222 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 223 | $qb |
|
| 224 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 222-226 (lines=5) @@ | ||
| 219 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 220 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 221 | } |
|
| 222 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 223 | $qb |
|
| 224 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 225 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 226 | } |
|
| 227 | ||
| 228 | // buy_product_name |
|
| 229 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 253-257 (lines=5) @@ | ||
| 250 | $qb = $this->createQueryBuilder('o'); |
|
| 251 | ||
| 252 | // order_id_start |
|
| 253 | if (isset($searchData['order_id_start']) && Str::isNotBlank($searchData['order_id_start'])) { |
|
| 254 | $qb |
|
| 255 | ->andWhere('o.id >= :order_id_start') |
|
| 256 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 257 | } |
|
| 258 | // multi |
|
| 259 | if (isset( $searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
| 260 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 269-273 (lines=5) @@ | ||
| 266 | } |
|
| 267 | ||
| 268 | // order_id_end |
|
| 269 | if (isset($searchData['order_id_end']) && Str::isNotBlank($searchData['order_id_end'])) { |
|
| 270 | $qb |
|
| 271 | ->andWhere('o.id <= :order_id_end') |
|
| 272 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 273 | } |
|
| 274 | ||
| 275 | // status |
|
| 276 | $filterStatus = false; |
|
| @@ 299-303 (lines=5) @@ | ||
| 296 | } |
|
| 297 | ||
| 298 | // name |
|
| 299 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| 300 | $qb |
|
| 301 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 302 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 303 | } |
|
| 304 | ||
| 305 | // kana |
|
| 306 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 306-310 (lines=5) @@ | ||
| 303 | } |
|
| 304 | ||
| 305 | // kana |
|
| 306 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| 307 | $qb |
|
| 308 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 309 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 310 | } |
|
| 311 | ||
| 312 | ||
| 313 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 313-317 (lines=5) @@ | ||
| 310 | } |
|
| 311 | ||
| 312 | ||
| 313 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 314 | $qb |
|
| 315 | ->andWhere('o.email like :email') |
|
| 316 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 317 | } |
|
| 318 | ||
| 319 | // tel |
|
| 320 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| @@ 320-324 (lines=5) @@ | ||
| 317 | } |
|
| 318 | ||
| 319 | // tel |
|
| 320 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 321 | $qb |
|
| 322 | ->andWhere('CONCAT(o.tel01, o.tel02, o.tel03) LIKE :tel') |
|
| 323 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 324 | } |
|
| 325 | ||
| 326 | // sex |
|
| 327 | if (!empty($searchData['sex']) && count($searchData['sex']) > 0) { |
|
| @@ 411-415 (lines=5) @@ | ||
| 408 | } |
|
| 409 | ||
| 410 | // payment_total |
|
| 411 | if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) { |
|
| 412 | $qb |
|
| 413 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 414 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 415 | } |
|
| 416 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 417 | $qb |
|
| 418 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 416-420 (lines=5) @@ | ||
| 413 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 414 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 415 | } |
|
| 416 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 417 | $qb |
|
| 418 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 419 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 420 | } |
|
| 421 | ||
| 422 | // buy_product_name |
|
| 423 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 49-53 (lines=5) @@ | ||
| 46 | $qb->leftJoin('s.ShipmentItems', 'si') |
|
| 47 | ->leftJoin('si.Order', 'o'); |
|
| 48 | // order_id_start |
|
| 49 | if (isset($searchData['shipping_id_start']) && Str::isNotBlank($searchData['shipping_id_start'])) { |
|
| 50 | $qb |
|
| 51 | ->andWhere('s.id >= :shipping_id_start') |
|
| 52 | ->setParameter('shipping_id_start', $searchData['shipping_id_start']); |
|
| 53 | } |
|
| 54 | // multi |
|
| 55 | if (isset( $searchData['multi']) && Str::isNotBlank($searchData['multi'])) { |
|
| 56 | $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 65-69 (lines=5) @@ | ||
| 62 | } |
|
| 63 | ||
| 64 | // shipping_id_end |
|
| 65 | if (isset($searchData['shipping_id_end']) && Str::isNotBlank($searchData['shipping_id_end'])) { |
|
| 66 | $qb |
|
| 67 | ->andWhere('s.id <= :shipping_id_end') |
|
| 68 | ->setParameter('shipping_id_end', $searchData['shipping_id_end']); |
|
| 69 | } |
|
| 70 | ||
| 71 | // order_id |
|
| 72 | if (isset($searchData['order_id']) && Str::isNotBlank($searchData['order_id'])) { |
|
| @@ 72-76 (lines=5) @@ | ||
| 69 | } |
|
| 70 | ||
| 71 | // order_id |
|
| 72 | if (isset($searchData['order_id']) && Str::isNotBlank($searchData['order_id'])) { |
|
| 73 | $qb |
|
| 74 | ->andWhere('o.id = :order_id') |
|
| 75 | ->setParameter('order_id', $searchData['order_id']); |
|
| 76 | } |
|
| 77 | ||
| 78 | // status |
|
| 79 | if (!empty($searchData['status']) && $searchData['status']) { |
|
| @@ 91-95 (lines=5) @@ | ||
| 88 | $filterStatus = true; |
|
| 89 | } |
|
| 90 | // name |
|
| 91 | if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) { |
|
| 92 | $qb |
|
| 93 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 94 | ->setParameter('name', '%' . $searchData['name'] . '%'); |
|
| 95 | } |
|
| 96 | ||
| 97 | // kana |
|
| 98 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| @@ 98-102 (lines=5) @@ | ||
| 95 | } |
|
| 96 | ||
| 97 | // kana |
|
| 98 | if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) { |
|
| 99 | $qb |
|
| 100 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 101 | ->setParameter('kana', '%' . $searchData['kana'] . '%'); |
|
| 102 | } |
|
| 103 | ||
| 104 | // order_name |
|
| 105 | if (isset($searchData['order_name']) && Str::isNotBlank($searchData['order_name'])) { |
|
| @@ 105-109 (lines=5) @@ | ||
| 102 | } |
|
| 103 | ||
| 104 | // order_name |
|
| 105 | if (isset($searchData['order_name']) && Str::isNotBlank($searchData['order_name'])) { |
|
| 106 | $qb |
|
| 107 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 108 | ->setParameter('order_name', '%' . $searchData['order_name'] . '%'); |
|
| 109 | } |
|
| 110 | ||
| 111 | // order_kana |
|
| 112 | if (isset($searchData['order_kana']) && Str::isNotBlank($searchData['order_kana'])) { |
|
| @@ 112-116 (lines=5) @@ | ||
| 109 | } |
|
| 110 | ||
| 111 | // order_kana |
|
| 112 | if (isset($searchData['order_kana']) && Str::isNotBlank($searchData['order_kana'])) { |
|
| 113 | $qb |
|
| 114 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 115 | ->setParameter('kana', '%' . $searchData['order_kana'] . '%'); |
|
| 116 | } |
|
| 117 | ||
| 118 | // order_email |
|
| 119 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| @@ 119-123 (lines=5) @@ | ||
| 116 | } |
|
| 117 | ||
| 118 | // order_email |
|
| 119 | if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) { |
|
| 120 | $qb |
|
| 121 | ->andWhere('o.email like :email') |
|
| 122 | ->setParameter('email', '%' . $searchData['email'] . '%'); |
|
| 123 | } |
|
| 124 | ||
| 125 | // tel |
|
| 126 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| @@ 126-130 (lines=5) @@ | ||
| 123 | } |
|
| 124 | ||
| 125 | // tel |
|
| 126 | if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) { |
|
| 127 | $qb |
|
| 128 | ->andWhere('CONCAT(s.tel01, s.tel02, s.tel03) LIKE :tel') |
|
| 129 | ->setParameter('tel', '%' . $searchData['tel'] . '%'); |
|
| 130 | } |
|
| 131 | ||
| 132 | // payment |
|
| 133 | if (!empty($searchData['payment']) && count($searchData['payment'])) { |
|
| @@ 210-214 (lines=5) @@ | ||
| 207 | } |
|
| 208 | ||
| 209 | // payment_total |
|
| 210 | if (isset($searchData['payment_total_start']) && Str::isNotBlank($searchData['payment_total_start'])) { |
|
| 211 | $qb |
|
| 212 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 213 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 214 | } |
|
| 215 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 216 | $qb |
|
| 217 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 215-219 (lines=5) @@ | ||
| 212 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 213 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 214 | } |
|
| 215 | if (isset($searchData['payment_total_end']) && Str::isNotBlank($searchData['payment_total_end'])) { |
|
| 216 | $qb |
|
| 217 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 218 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 219 | } |
|
| 220 | ||
| 221 | // buy_product_name |
|
| 222 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 222-226 (lines=5) @@ | ||
| 219 | } |
|
| 220 | ||
| 221 | // buy_product_name |
|
| 222 | if (isset($searchData['buy_product_name']) && Str::isNotBlank($searchData['buy_product_name'])) { |
|
| 223 | $qb |
|
| 224 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 225 | ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%'); |
|
| 226 | } |
|
| 227 | ||
| 228 | // Order By |
|
| 229 | $qb->orderBy('s.update_date', 'DESC'); |
|