| @@ 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']) { |
|
| @@ 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'])) { |
|
| @@ 92-96 (lines=5) @@ | ||
| 89 | ->setParameter('order_status', $searchData['order_status']); |
|
| 90 | } |
|
| 91 | // name |
|
| 92 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 93 | $qb |
|
| 94 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 95 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 96 | } |
|
| 97 | ||
| 98 | // kana |
|
| 99 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 99-103 (lines=5) @@ | ||
| 96 | } |
|
| 97 | ||
| 98 | // kana |
|
| 99 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 100 | $qb |
|
| 101 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 102 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 103 | } |
|
| 104 | ||
| 105 | // order_name |
|
| 106 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| @@ 106-110 (lines=5) @@ | ||
| 103 | } |
|
| 104 | ||
| 105 | // order_name |
|
| 106 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| 107 | $qb |
|
| 108 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 109 | ->setParameter('order_name', '%'.$searchData['order_name'].'%'); |
|
| 110 | } |
|
| 111 | ||
| 112 | // order_kana |
|
| 113 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| @@ 113-117 (lines=5) @@ | ||
| 110 | } |
|
| 111 | ||
| 112 | // order_kana |
|
| 113 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| 114 | $qb |
|
| 115 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 116 | ->setParameter('order_kana', '%'.$searchData['order_kana'].'%'); |
|
| 117 | } |
|
| 118 | ||
| 119 | // order_email |
|
| 120 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 120-124 (lines=5) @@ | ||
| 117 | } |
|
| 118 | ||
| 119 | // order_email |
|
| 120 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 121 | $qb |
|
| 122 | ->andWhere('o.email like :email') |
|
| 123 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 124 | } |
|
| 125 | ||
| 126 | // tel |
|
| 127 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 211-215 (lines=5) @@ | ||
| 208 | } |
|
| 209 | ||
| 210 | // payment_total |
|
| 211 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 212 | $qb |
|
| 213 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 214 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 215 | } |
|
| 216 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 217 | $qb |
|
| 218 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 216-220 (lines=5) @@ | ||
| 213 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 214 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 215 | } |
|
| 216 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 217 | $qb |
|
| 218 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 219 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 220 | } |
|
| 221 | ||
| 222 | // buy_product_name |
|
| 223 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 223-227 (lines=5) @@ | ||
| 220 | } |
|
| 221 | ||
| 222 | // buy_product_name |
|
| 223 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 224 | $qb |
|
| 225 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 226 | ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 227 | } |
|
| 228 | ||
| 229 | // Order By |
|
| 230 | $qb->orderBy('s.update_date', 'DESC'); |
|
| @@ 82-86 (lines=5) @@ | ||
| 79 | $joinedCustomer = false; |
|
| 80 | ||
| 81 | // order_id_start |
|
| 82 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 83 | $qb |
|
| 84 | ->andWhere('o.id >= :order_id_start') |
|
| 85 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 86 | } |
|
| 87 | ||
| 88 | // order_id_end |
|
| 89 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| @@ 89-93 (lines=5) @@ | ||
| 86 | } |
|
| 87 | ||
| 88 | // order_id_end |
|
| 89 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 90 | $qb |
|
| 91 | ->andWhere('o.id <= :order_id_end') |
|
| 92 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 93 | } |
|
| 94 | ||
| 95 | // status |
|
| 96 | if (!empty($searchData['status']) && $searchData['status']) { |
|
| @@ 103-107 (lines=5) @@ | ||
| 100 | } |
|
| 101 | ||
| 102 | // name |
|
| 103 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 104 | $qb |
|
| 105 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 106 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 107 | } |
|
| 108 | ||
| 109 | // kana |
|
| 110 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 110-114 (lines=5) @@ | ||
| 107 | } |
|
| 108 | ||
| 109 | // kana |
|
| 110 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 111 | $qb |
|
| 112 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 113 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 114 | } |
|
| 115 | ||
| 116 | ||
| 117 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 117-121 (lines=5) @@ | ||
| 114 | } |
|
| 115 | ||
| 116 | ||
| 117 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 118 | $qb |
|
| 119 | ->andWhere('o.email = :email') |
|
| 120 | ->setParameter('email', $searchData['email']); |
|
| 121 | } |
|
| 122 | ||
| 123 | // tel |
|
| 124 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 124-128 (lines=5) @@ | ||
| 121 | } |
|
| 122 | ||
| 123 | // tel |
|
| 124 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| 125 | $qb |
|
| 126 | ->andWhere('o.phone_number = :phone_number') |
|
| 127 | ->setParameter('phone_number', $searchData['phone_number']); |
|
| 128 | } |
|
| 129 | ||
| 130 | // birth |
|
| 131 | if (!empty($searchData['birth_start']) && $searchData['birth_start']) { |
|
| @@ 218-222 (lines=5) @@ | ||
| 215 | } |
|
| 216 | ||
| 217 | // payment_total |
|
| 218 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 219 | $qb |
|
| 220 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 221 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 222 | } |
|
| 223 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 224 | $qb |
|
| 225 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 223-227 (lines=5) @@ | ||
| 220 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 221 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 222 | } |
|
| 223 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 224 | $qb |
|
| 225 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 226 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 227 | } |
|
| 228 | ||
| 229 | // buy_product_name |
|
| 230 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 255-259 (lines=5) @@ | ||
| 252 | ->innerJoin('o.Shippings', 's'); |
|
| 253 | ||
| 254 | // order_id_start |
|
| 255 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 256 | $qb |
|
| 257 | ->andWhere('o.id = :order_id') |
|
| 258 | ->setParameter('order_id', $searchData['order_id']); |
|
| 259 | } |
|
| 260 | ||
| 261 | // order_no |
|
| 262 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| @@ 262-266 (lines=5) @@ | ||
| 259 | } |
|
| 260 | ||
| 261 | // order_no |
|
| 262 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| 263 | $qb |
|
| 264 | ->andWhere('o.order_no = :order_no') |
|
| 265 | ->setParameter('order_no', $searchData['order_no']); |
|
| 266 | } |
|
| 267 | ||
| 268 | // order_id_start |
|
| 269 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| @@ 269-273 (lines=5) @@ | ||
| 266 | } |
|
| 267 | ||
| 268 | // order_id_start |
|
| 269 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 270 | $qb |
|
| 271 | ->andWhere('o.id >= :order_id_start') |
|
| 272 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 273 | } |
|
| 274 | // multi |
|
| 275 | if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 276 | $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 286-290 (lines=5) @@ | ||
| 283 | } |
|
| 284 | ||
| 285 | // order_id_end |
|
| 286 | if (isset($searchData['order_id_end']) && StringUtil::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; |
|
| @@ 311-315 (lines=5) @@ | ||
| 308 | } |
|
| 309 | ||
| 310 | // company_name |
|
| 311 | if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) { |
|
| 312 | $qb |
|
| 313 | ->andWhere('o.company_name LIKE :company_name') |
|
| 314 | ->setParameter('company_name', '%'.$searchData['company_name'].'%'); |
|
| 315 | } |
|
| 316 | ||
| 317 | // name |
|
| 318 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 318-322 (lines=5) @@ | ||
| 315 | } |
|
| 316 | ||
| 317 | // name |
|
| 318 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 319 | $qb |
|
| 320 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 321 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 322 | } |
|
| 323 | ||
| 324 | // kana |
|
| 325 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 325-329 (lines=5) @@ | ||
| 322 | } |
|
| 323 | ||
| 324 | // kana |
|
| 325 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 326 | $qb |
|
| 327 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 328 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 329 | } |
|
| 330 | ||
| 331 | ||
| 332 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 332-336 (lines=5) @@ | ||
| 329 | } |
|
| 330 | ||
| 331 | ||
| 332 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 333 | $qb |
|
| 334 | ->andWhere('o.email like :email') |
|
| 335 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 336 | } |
|
| 337 | ||
| 338 | // tel |
|
| 339 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 414-418 (lines=5) @@ | ||
| 411 | } |
|
| 412 | ||
| 413 | // payment_total |
|
| 414 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 415 | $qb |
|
| 416 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 417 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 418 | } |
|
| 419 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 420 | $qb |
|
| 421 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 419-423 (lines=5) @@ | ||
| 416 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 417 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 418 | } |
|
| 419 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 420 | $qb |
|
| 421 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 422 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 423 | } |
|
| 424 | ||
| 425 | // buy_product_name |
|
| 426 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|