| @@ 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['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 127-131 (lines=5) @@ | ||
| 124 | } |
|
| 125 | ||
| 126 | // tel |
|
| 127 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| 128 | $qb |
|
| 129 | ->andWhere('o.phone_number = :phone_number') |
|
| 130 | ->setParameter('phone_number', $searchData['phone_number']); |
|
| 131 | } |
|
| 132 | ||
| 133 | // birth |
|
| 134 | if (!empty($searchData['birth_start']) && $searchData['birth_start']) { |
|
| @@ 221-225 (lines=5) @@ | ||
| 218 | } |
|
| 219 | ||
| 220 | // payment_total |
|
| 221 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 222 | $qb |
|
| 223 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 224 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 225 | } |
|
| 226 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 227 | $qb |
|
| 228 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 226-230 (lines=5) @@ | ||
| 223 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 224 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 225 | } |
|
| 226 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 227 | $qb |
|
| 228 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 229 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 230 | } |
|
| 231 | ||
| 232 | // buy_product_name |
|
| 233 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 256-260 (lines=5) @@ | ||
| 253 | $qb = $this->createQueryBuilder('o'); |
|
| 254 | ||
| 255 | // order_id_start |
|
| 256 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 257 | $qb |
|
| 258 | ->andWhere('o.id = :order_id') |
|
| 259 | ->setParameter('order_id', $searchData['order_id']); |
|
| 260 | } |
|
| 261 | ||
| 262 | // order_no |
|
| 263 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| @@ 270-274 (lines=5) @@ | ||
| 267 | } |
|
| 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{0,10}$/', $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; |
|
| @@ 312-316 (lines=5) @@ | ||
| 309 | } |
|
| 310 | ||
| 311 | // company_name |
|
| 312 | if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) { |
|
| 313 | $qb |
|
| 314 | ->andWhere('o.company_name LIKE :company_name') |
|
| 315 | ->setParameter('company_name', '%'.$searchData['company_name'].'%'); |
|
| 316 | } |
|
| 317 | ||
| 318 | // name |
|
| 319 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 319-323 (lines=5) @@ | ||
| 316 | } |
|
| 317 | ||
| 318 | // name |
|
| 319 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 320 | $qb |
|
| 321 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 322 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 323 | } |
|
| 324 | ||
| 325 | // kana |
|
| 326 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 326-330 (lines=5) @@ | ||
| 323 | } |
|
| 324 | ||
| 325 | // kana |
|
| 326 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 327 | $qb |
|
| 328 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 329 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 330 | } |
|
| 331 | ||
| 332 | ||
| 333 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 333-337 (lines=5) @@ | ||
| 330 | } |
|
| 331 | ||
| 332 | ||
| 333 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 334 | $qb |
|
| 335 | ->andWhere('o.email like :email') |
|
| 336 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 337 | } |
|
| 338 | ||
| 339 | // tel |
|
| 340 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 431-435 (lines=5) @@ | ||
| 428 | } |
|
| 429 | ||
| 430 | // payment_total |
|
| 431 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 432 | $qb |
|
| 433 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 434 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 435 | } |
|
| 436 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 437 | $qb |
|
| 438 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 436-440 (lines=5) @@ | ||
| 433 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 434 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 435 | } |
|
| 436 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 437 | $qb |
|
| 438 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 439 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 440 | } |
|
| 441 | ||
| 442 | // buy_product_name |
|
| 443 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 263-267 (lines=5) @@ | ||
| 260 | } |
|
| 261 | ||
| 262 | // order_no |
|
| 263 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| 264 | $qb |
|
| 265 | ->andWhere('o.order_no = :order_no') |
|
| 266 | ->setParameter('order_no', $searchData['order_no']); |
|
| 267 | } |
|
| 268 | ||
| 269 | // order_id_start |
|
| 270 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| @@ 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_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| @@ 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['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 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'); |
|