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