| @@ 163-167 (lines=5) @@ | ||
| 160 | } |
|
| 161 | ||
| 162 | // buy_total |
|
| 163 | if (isset($searchData['buy_total_start']) && StringUtil::isNotBlank($searchData['buy_total_start'])) { |
|
| 164 | $qb |
|
| 165 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 166 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 167 | } |
|
| 168 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 169 | $qb |
|
| 170 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| @@ 168-172 (lines=5) @@ | ||
| 165 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 166 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 167 | } |
|
| 168 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 169 | $qb |
|
| 170 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| 171 | ->setParameter('buy_total_end', $searchData['buy_total_end']); |
|
| 172 | } |
|
| 173 | ||
| 174 | // buy_times |
|
| 175 | if (!empty($searchData['buy_times_start']) && $searchData['buy_times_start']) { |
|
| @@ 85-89 (lines=5) @@ | ||
| 82 | $joinedCustomer = false; |
|
| 83 | ||
| 84 | // order_id_start |
|
| 85 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 86 | $qb |
|
| 87 | ->andWhere('o.id >= :order_id_start') |
|
| 88 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 89 | } |
|
| 90 | ||
| 91 | // order_id_end |
|
| 92 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| @@ 92-96 (lines=5) @@ | ||
| 89 | } |
|
| 90 | ||
| 91 | // order_id_end |
|
| 92 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 93 | $qb |
|
| 94 | ->andWhere('o.id <= :order_id_end') |
|
| 95 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 96 | } |
|
| 97 | ||
| 98 | // status |
|
| 99 | if (!empty($searchData['status']) && $searchData['status']) { |
|
| @@ 106-110 (lines=5) @@ | ||
| 103 | } |
|
| 104 | ||
| 105 | // name |
|
| 106 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 107 | $qb |
|
| 108 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 109 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 110 | } |
|
| 111 | ||
| 112 | // kana |
|
| 113 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 113-117 (lines=5) @@ | ||
| 110 | } |
|
| 111 | ||
| 112 | // kana |
|
| 113 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 114 | $qb |
|
| 115 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 116 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 117 | } |
|
| 118 | ||
| 119 | ||
| 120 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 120-124 (lines=5) @@ | ||
| 117 | } |
|
| 118 | ||
| 119 | ||
| 120 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 121 | $qb |
|
| 122 | ->andWhere('o.email = :email') |
|
| 123 | ->setParameter('email', $searchData['email']); |
|
| 124 | } |
|
| 125 | ||
| 126 | // tel |
|
| 127 | if (isset($searchData['tel01']) && StringUtil::isNotBlank($searchData['tel01'])) { |
|
| @@ 127-131 (lines=5) @@ | ||
| 124 | } |
|
| 125 | ||
| 126 | // tel |
|
| 127 | if (isset($searchData['tel01']) && StringUtil::isNotBlank($searchData['tel01'])) { |
|
| 128 | $qb |
|
| 129 | ->andWhere('o.tel01 = :tel01') |
|
| 130 | ->setParameter('tel01', $searchData['tel01']); |
|
| 131 | } |
|
| 132 | if (isset($searchData['tel02']) && StringUtil::isNotBlank($searchData['tel02'])) { |
|
| 133 | $qb |
|
| 134 | ->andWhere('o.tel02 = :tel02') |
|
| @@ 132-136 (lines=5) @@ | ||
| 129 | ->andWhere('o.tel01 = :tel01') |
|
| 130 | ->setParameter('tel01', $searchData['tel01']); |
|
| 131 | } |
|
| 132 | if (isset($searchData['tel02']) && StringUtil::isNotBlank($searchData['tel02'])) { |
|
| 133 | $qb |
|
| 134 | ->andWhere('o.tel02 = :tel02') |
|
| 135 | ->setParameter('tel02', $searchData['tel02']); |
|
| 136 | } |
|
| 137 | if (isset($searchData['tel03']) && StringUtil::isNotBlank($searchData['tel03'])) { |
|
| 138 | $qb |
|
| 139 | ->andWhere('o.tel03 = :tel03') |
|
| @@ 137-141 (lines=5) @@ | ||
| 134 | ->andWhere('o.tel02 = :tel02') |
|
| 135 | ->setParameter('tel02', $searchData['tel02']); |
|
| 136 | } |
|
| 137 | if (isset($searchData['tel03']) && StringUtil::isNotBlank($searchData['tel03'])) { |
|
| 138 | $qb |
|
| 139 | ->andWhere('o.tel03 = :tel03') |
|
| 140 | ->setParameter('tel03', $searchData['tel03']); |
|
| 141 | } |
|
| 142 | ||
| 143 | // birth |
|
| 144 | if (!empty($searchData['birth_start']) && $searchData['birth_start']) { |
|
| @@ 231-235 (lines=5) @@ | ||
| 228 | } |
|
| 229 | ||
| 230 | // payment_total |
|
| 231 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 232 | $qb |
|
| 233 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 234 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 235 | } |
|
| 236 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 237 | $qb |
|
| 238 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 236-240 (lines=5) @@ | ||
| 233 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 234 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 235 | } |
|
| 236 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 237 | $qb |
|
| 238 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 239 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 240 | } |
|
| 241 | ||
| 242 | // buy_product_name |
|
| 243 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 266-270 (lines=5) @@ | ||
| 263 | $qb = $this->createQueryBuilder('o'); |
|
| 264 | ||
| 265 | // order_id_start |
|
| 266 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 267 | $qb |
|
| 268 | ->andWhere('o.id = :order_id') |
|
| 269 | ->setParameter('order_id', $searchData['order_id']); |
|
| 270 | } |
|
| 271 | ||
| 272 | // order_code |
|
| 273 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| @@ 273-277 (lines=5) @@ | ||
| 270 | } |
|
| 271 | ||
| 272 | // order_code |
|
| 273 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| 274 | $qb |
|
| 275 | ->andWhere('o.order_code = :order_code') |
|
| 276 | ->setParameter('order_code', $searchData['order_code']); |
|
| 277 | } |
|
| 278 | ||
| 279 | // order_id_start |
|
| 280 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| @@ 280-284 (lines=5) @@ | ||
| 277 | } |
|
| 278 | ||
| 279 | // order_id_start |
|
| 280 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 281 | $qb |
|
| 282 | ->andWhere('o.id >= :order_id_start') |
|
| 283 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 284 | } |
|
| 285 | // multi |
|
| 286 | if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 287 | $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 297-301 (lines=5) @@ | ||
| 294 | } |
|
| 295 | ||
| 296 | // order_id_end |
|
| 297 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 298 | $qb |
|
| 299 | ->andWhere('o.id <= :order_id_end') |
|
| 300 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 301 | } |
|
| 302 | ||
| 303 | // status |
|
| 304 | $filterStatus = false; |
|
| @@ 322-326 (lines=5) @@ | ||
| 319 | } |
|
| 320 | ||
| 321 | // company_name |
|
| 322 | if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) { |
|
| 323 | $qb |
|
| 324 | ->andWhere('o.company_name LIKE :company_name') |
|
| 325 | ->setParameter('company_name', '%'.$searchData['company_name'].'%'); |
|
| 326 | } |
|
| 327 | ||
| 328 | // name |
|
| 329 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 329-333 (lines=5) @@ | ||
| 326 | } |
|
| 327 | ||
| 328 | // name |
|
| 329 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 330 | $qb |
|
| 331 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 332 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 333 | } |
|
| 334 | ||
| 335 | // kana |
|
| 336 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 336-340 (lines=5) @@ | ||
| 333 | } |
|
| 334 | ||
| 335 | // kana |
|
| 336 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 337 | $qb |
|
| 338 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 339 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 340 | } |
|
| 341 | ||
| 342 | ||
| 343 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 343-347 (lines=5) @@ | ||
| 340 | } |
|
| 341 | ||
| 342 | ||
| 343 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 344 | $qb |
|
| 345 | ->andWhere('o.email like :email') |
|
| 346 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 347 | } |
|
| 348 | ||
| 349 | // tel |
|
| 350 | if (isset($searchData['tel']) && StringUtil::isNotBlank($searchData['tel'])) { |
|
| @@ 441-445 (lines=5) @@ | ||
| 438 | } |
|
| 439 | ||
| 440 | // payment_total |
|
| 441 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 442 | $qb |
|
| 443 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 444 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 445 | } |
|
| 446 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 447 | $qb |
|
| 448 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 446-450 (lines=5) @@ | ||
| 443 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 444 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 445 | } |
|
| 446 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 447 | $qb |
|
| 448 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 449 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 450 | } |
|
| 451 | ||
| 452 | // buy_product_name |
|
| 453 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 48-52 (lines=5) @@ | ||
| 45 | $qb->leftJoin('s.OrderItems', 'si') |
|
| 46 | ->leftJoin('si.Order', 'o'); |
|
| 47 | // order_id_start |
|
| 48 | if (isset($searchData['shipping_id_start']) && StringUtil::isNotBlank($searchData['shipping_id_start'])) { |
|
| 49 | $qb |
|
| 50 | ->andWhere('s.id >= :shipping_id_start') |
|
| 51 | ->setParameter('shipping_id_start', $searchData['shipping_id_start']); |
|
| 52 | } |
|
| 53 | // multi |
|
| 54 | if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 55 | $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 64-68 (lines=5) @@ | ||
| 61 | } |
|
| 62 | ||
| 63 | // shipping_id_end |
|
| 64 | if (isset($searchData['shipping_id_end']) && StringUtil::isNotBlank($searchData['shipping_id_end'])) { |
|
| 65 | $qb |
|
| 66 | ->andWhere('s.id <= :shipping_id_end') |
|
| 67 | ->setParameter('shipping_id_end', $searchData['shipping_id_end']); |
|
| 68 | } |
|
| 69 | ||
| 70 | // order_id |
|
| 71 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| @@ 71-75 (lines=5) @@ | ||
| 68 | } |
|
| 69 | ||
| 70 | // order_id |
|
| 71 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 72 | $qb |
|
| 73 | ->andWhere('o.id = :order_id') |
|
| 74 | ->setParameter('order_id', $searchData['order_id']); |
|
| 75 | } |
|
| 76 | ||
| 77 | // order_no |
|
| 78 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| @@ 78-82 (lines=5) @@ | ||
| 75 | } |
|
| 76 | ||
| 77 | // order_no |
|
| 78 | if (isset($searchData['order_code']) && StringUtil::isNotBlank($searchData['order_code'])) { |
|
| 79 | $qb |
|
| 80 | ->andWhere('o.order_code LIKE :order_code') |
|
| 81 | ->setParameter('order_code', "%{$searchData['order_code']}%"); |
|
| 82 | } |
|
| 83 | ||
| 84 | // order status |
|
| 85 | if (isset($searchData['order_status']) && count($searchData['order_status'])) { |
|
| @@ 98-102 (lines=5) @@ | ||
| 95 | ->setParameter('shipping_status', $searchData['shipping_status']); |
|
| 96 | } |
|
| 97 | // name |
|
| 98 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 99 | $qb |
|
| 100 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 101 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 102 | } |
|
| 103 | ||
| 104 | // kana |
|
| 105 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 105-109 (lines=5) @@ | ||
| 102 | } |
|
| 103 | ||
| 104 | // kana |
|
| 105 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 106 | $qb |
|
| 107 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 108 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 109 | } |
|
| 110 | ||
| 111 | // order_name |
|
| 112 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| @@ 112-116 (lines=5) @@ | ||
| 109 | } |
|
| 110 | ||
| 111 | // order_name |
|
| 112 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| 113 | $qb |
|
| 114 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 115 | ->setParameter('order_name', '%'.$searchData['order_name'].'%'); |
|
| 116 | } |
|
| 117 | ||
| 118 | // order_kana |
|
| 119 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| @@ 119-123 (lines=5) @@ | ||
| 116 | } |
|
| 117 | ||
| 118 | // order_kana |
|
| 119 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| 120 | $qb |
|
| 121 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 122 | ->setParameter('order_kana', '%'.$searchData['order_kana'].'%'); |
|
| 123 | } |
|
| 124 | ||
| 125 | // order_email |
|
| 126 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 126-130 (lines=5) @@ | ||
| 123 | } |
|
| 124 | ||
| 125 | // order_email |
|
| 126 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 127 | $qb |
|
| 128 | ->andWhere('o.email like :email') |
|
| 129 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 130 | } |
|
| 131 | ||
| 132 | // tel |
|
| 133 | if (isset($searchData['tel']) && StringUtil::isNotBlank($searchData['tel'])) { |
|
| @@ 217-221 (lines=5) @@ | ||
| 214 | } |
|
| 215 | ||
| 216 | // payment_total |
|
| 217 | if (isset($searchData['payment_total_start']) && StringUtil::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']) && StringUtil::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']) && StringUtil::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']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 229-233 (lines=5) @@ | ||
| 226 | } |
|
| 227 | ||
| 228 | // buy_product_name |
|
| 229 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 230 | $qb |
|
| 231 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 232 | ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 233 | } |
|
| 234 | ||
| 235 | // Order By |
|
| 236 | $qb->orderBy('s.update_date', 'DESC'); |
|