| @@ 200-211 (lines=12) @@ | ||
| 197 | ->setParameter('create_date_start', $searchData['create_date_start']); |
|
| 198 | } |
|
| 199 | ||
| 200 | if (!empty($searchData['create_datetime_end']) && $searchData['create_datetime_end']) { |
|
| 201 | $date = $searchData['create_datetime_end']; |
|
| 202 | $qb |
|
| 203 | ->andWhere('c.create_date < :create_date_end') |
|
| 204 | ->setParameter('create_date_end', $date); |
|
| 205 | } elseif (!empty($searchData['create_date_end']) && $searchData['create_date_end']) { |
|
| 206 | $date = clone $searchData['create_date_end']; |
|
| 207 | $date->modify('+1 days'); |
|
| 208 | $qb |
|
| 209 | ->andWhere('c.create_date < :create_date_end') |
|
| 210 | ->setParameter('create_date_end', $date); |
|
| 211 | } |
|
| 212 | ||
| 213 | // update_date |
|
| 214 | if (!empty($searchData['update_datetime_start']) && $searchData['update_datetime_start']) { |
|
| @@ 225-236 (lines=12) @@ | ||
| 222 | ->setParameter('update_date_start', $searchData['update_date_start']); |
|
| 223 | } |
|
| 224 | ||
| 225 | if (!empty($searchData['update_datetime_end']) && $searchData['update_datetime_end']) { |
|
| 226 | $date = $searchData['update_datetime_end']; |
|
| 227 | $qb |
|
| 228 | ->andWhere('c.update_date < :update_date_end') |
|
| 229 | ->setParameter('update_date_end', $date); |
|
| 230 | } elseif (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
| 231 | $date = clone $searchData['update_date_end']; |
|
| 232 | $date->modify('+1 days'); |
|
| 233 | $qb |
|
| 234 | ->andWhere('c.update_date < :update_date_end') |
|
| 235 | ->setParameter('update_date_end', $date); |
|
| 236 | } |
|
| 237 | ||
| 238 | // last_buy |
|
| 239 | if (!empty($searchData['last_buy_datetime_start']) && $searchData['last_buy_datetime_start']) { |
|
| @@ 250-261 (lines=12) @@ | ||
| 247 | ->setParameter('last_buy_start', $searchData['last_buy_start']); |
|
| 248 | } |
|
| 249 | ||
| 250 | if (!empty($searchData['last_buy_datetime_end']) && $searchData['last_buy_datetime_end']) { |
|
| 251 | $date = $searchData['last_buy_datetime_end']; |
|
| 252 | $qb |
|
| 253 | ->andWhere('c.last_buy_date < :last_buy_end') |
|
| 254 | ->setParameter('last_buy_end', $date); |
|
| 255 | } elseif (!empty($searchData['last_buy_end']) && $searchData['last_buy_end']) { |
|
| 256 | $date = clone $searchData['last_buy_end']; |
|
| 257 | $date->modify('+1 days'); |
|
| 258 | $qb |
|
| 259 | ->andWhere('c.last_buy_date < :last_buy_end') |
|
| 260 | ->setParameter('last_buy_end', $date); |
|
| 261 | } |
|
| 262 | ||
| 263 | // status |
|
| 264 | if (!empty($searchData['customer_status']) && count($searchData['customer_status']) > 0) { |
|
| @@ 199-209 (lines=11) @@ | ||
| 196 | } |
|
| 197 | ||
| 198 | // oreder_date |
|
| 199 | if (!empty($searchData['order_datetime_start']) && $searchData['order_datetime_start']) { |
|
| 200 | $date = $searchData['order_datetime_start']; |
|
| 201 | $qb |
|
| 202 | ->andWhere('o.order_date >= :order_date_start') |
|
| 203 | ->setParameter('order_date_start', $date); |
|
| 204 | } elseif (!empty($searchData['order_date_start']) && $searchData['order_date_start']) { |
|
| 205 | $date = $searchData['order_date_start']; |
|
| 206 | $qb |
|
| 207 | ->andWhere('o.order_date >= :order_date_start') |
|
| 208 | ->setParameter('order_date_start', $date); |
|
| 209 | } |
|
| 210 | ||
| 211 | if (!empty($searchData['order_datetime_end']) && $searchData['order_datetime_end']) { |
|
| 212 | $date = $searchData['order_datetime_end']; |
|
| @@ 211-223 (lines=13) @@ | ||
| 208 | ->setParameter('order_date_start', $date); |
|
| 209 | } |
|
| 210 | ||
| 211 | if (!empty($searchData['order_datetime_end']) && $searchData['order_datetime_end']) { |
|
| 212 | $date = $searchData['order_datetime_end']; |
|
| 213 | $qb |
|
| 214 | ->andWhere('o.order_date < :order_date_end') |
|
| 215 | ->setParameter('order_date_end', $date); |
|
| 216 | } elseif (!empty($searchData['order_date_end']) && $searchData['order_date_end']) { |
|
| 217 | $date = clone $searchData['order_date_end']; |
|
| 218 | $date = $date |
|
| 219 | ->modify('+1 days'); |
|
| 220 | $qb |
|
| 221 | ->andWhere('o.order_date < :order_date_end') |
|
| 222 | ->setParameter('order_date_end', $date); |
|
| 223 | } |
|
| 224 | ||
| 225 | // payment_date |
|
| 226 | if (!empty($searchData['payment_datetime_start']) && $searchData['payment_datetime_start']) { |
|
| @@ 226-236 (lines=11) @@ | ||
| 223 | } |
|
| 224 | ||
| 225 | // payment_date |
|
| 226 | if (!empty($searchData['payment_datetime_start']) && $searchData['payment_datetime_start']) { |
|
| 227 | $date = $searchData['payment_datetime_start']; |
|
| 228 | $qb |
|
| 229 | ->andWhere('o.payment_date >= :payment_date_start') |
|
| 230 | ->setParameter('payment_date_start', $date); |
|
| 231 | } elseif (!empty($searchData['payment_date_start']) && $searchData['payment_date_start']) { |
|
| 232 | $date = $searchData['payment_date_start']; |
|
| 233 | $qb |
|
| 234 | ->andWhere('o.payment_date >= :payment_date_start') |
|
| 235 | ->setParameter('payment_date_start', $date); |
|
| 236 | } |
|
| 237 | ||
| 238 | if (!empty($searchData['payment_datetime_end']) && $searchData['payment_datetime_end']) { |
|
| 239 | $date = $searchData['payment_datetime_end']; |
|
| @@ 238-250 (lines=13) @@ | ||
| 235 | ->setParameter('payment_date_start', $date); |
|
| 236 | } |
|
| 237 | ||
| 238 | if (!empty($searchData['payment_datetime_end']) && $searchData['payment_datetime_end']) { |
|
| 239 | $date = $searchData['payment_datetime_end']; |
|
| 240 | $qb |
|
| 241 | ->andWhere('o.payment_date < :payment_date_end') |
|
| 242 | ->setParameter('payment_date_end', $date); |
|
| 243 | } elseif (!empty($searchData['payment_date_end']) && $searchData['payment_date_end']) { |
|
| 244 | $date = clone $searchData['payment_date_end']; |
|
| 245 | $date = $date |
|
| 246 | ->modify('+1 days'); |
|
| 247 | $qb |
|
| 248 | ->andWhere('o.payment_date < :payment_date_end') |
|
| 249 | ->setParameter('payment_date_end', $date); |
|
| 250 | } |
|
| 251 | ||
| 252 | // update_date |
|
| 253 | if (!empty($searchData['update_datetime_start']) && $searchData['update_datetime_start']) { |
|
| @@ 253-263 (lines=11) @@ | ||
| 250 | } |
|
| 251 | ||
| 252 | // update_date |
|
| 253 | if (!empty($searchData['update_datetime_start']) && $searchData['update_datetime_start']) { |
|
| 254 | $date = $searchData['update_datetime_start']; |
|
| 255 | $qb |
|
| 256 | ->andWhere('o.update_date >= :update_date_start') |
|
| 257 | ->setParameter('update_date_start', $date); |
|
| 258 | } elseif (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
| 259 | $date = $searchData['update_date_start']; |
|
| 260 | $qb |
|
| 261 | ->andWhere('o.update_date >= :update_date_start') |
|
| 262 | ->setParameter('update_date_start', $date); |
|
| 263 | } |
|
| 264 | ||
| 265 | if (!empty($searchData['update_datetime_end']) && $searchData['update_datetime_end']) { |
|
| 266 | $date = $searchData['update_datetime_end']; |
|
| @@ 265-277 (lines=13) @@ | ||
| 262 | ->setParameter('update_date_start', $date); |
|
| 263 | } |
|
| 264 | ||
| 265 | if (!empty($searchData['update_datetime_end']) && $searchData['update_datetime_end']) { |
|
| 266 | $date = $searchData['update_datetime_end']; |
|
| 267 | $qb |
|
| 268 | ->andWhere('o.update_date < :update_date_end') |
|
| 269 | ->setParameter('update_date_end', $date); |
|
| 270 | } elseif (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
| 271 | $date = clone $searchData['update_date_end']; |
|
| 272 | $date = $date |
|
| 273 | ->modify('+1 days'); |
|
| 274 | $qb |
|
| 275 | ->andWhere('o.update_date < :update_date_end') |
|
| 276 | ->setParameter('update_date_end', $date); |
|
| 277 | } |
|
| 278 | ||
| 279 | // payment_total |
|
| 280 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| @@ 323-333 (lines=11) @@ | ||
| 320 | } |
|
| 321 | ||
| 322 | // お届け予定日(Shipping.delivery_date) |
|
| 323 | if (!empty($searchData['shipping_delivery_datetime_start']) && $searchData['shipping_delivery_datetime_start']) { |
|
| 324 | $date = $searchData['shipping_delivery_datetime_start']; |
|
| 325 | $qb |
|
| 326 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
| 327 | ->setParameter('shipping_delivery_date_start', $date); |
|
| 328 | } elseif (!empty($searchData['shipping_delivery_date_start']) && $searchData['shipping_delivery_date_start']) { |
|
| 329 | $date = $searchData['shipping_delivery_date_start']; |
|
| 330 | $qb |
|
| 331 | ->andWhere('s.shipping_delivery_date >= :shipping_delivery_date_start') |
|
| 332 | ->setParameter('shipping_delivery_date_start', $date); |
|
| 333 | } |
|
| 334 | ||
| 335 | if (!empty($searchData['shipping_delivery_datetime_end']) && $searchData['shipping_delivery_datetime_end']) { |
|
| 336 | $date = $searchData['shipping_delivery_datetime_end']; |
|
| @@ 335-347 (lines=13) @@ | ||
| 332 | ->setParameter('shipping_delivery_date_start', $date); |
|
| 333 | } |
|
| 334 | ||
| 335 | if (!empty($searchData['shipping_delivery_datetime_end']) && $searchData['shipping_delivery_datetime_end']) { |
|
| 336 | $date = $searchData['shipping_delivery_datetime_end']; |
|
| 337 | $qb |
|
| 338 | ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end') |
|
| 339 | ->setParameter('shipping_delivery_date_end', $date); |
|
| 340 | } elseif (!empty($searchData['shipping_delivery_date_end']) && $searchData['shipping_delivery_date_end']) { |
|
| 341 | $date = clone $searchData['shipping_delivery_date_end']; |
|
| 342 | $date = $date |
|
| 343 | ->modify('+1 days'); |
|
| 344 | $qb |
|
| 345 | ->andWhere('s.shipping_delivery_date < :shipping_delivery_date_end') |
|
| 346 | ->setParameter('shipping_delivery_date_end', $date); |
|
| 347 | } |
|
| 348 | ||
| 349 | // Order By |
|
| 350 | $qb->orderBy('o.update_date', 'DESC'); |
|
| @@ 307-317 (lines=11) @@ | ||
| 304 | } |
|
| 305 | ||
| 306 | // crate_date |
|
| 307 | if (!empty($searchData['create_datetime_start']) && $searchData['create_datetime_start']) { |
|
| 308 | $date = $searchData['create_datetime_start']; |
|
| 309 | $qb |
|
| 310 | ->andWhere('p.create_date >= :create_date_start') |
|
| 311 | ->setParameter('create_date_start', $date); |
|
| 312 | } elseif (!empty($searchData['create_date_start']) && $searchData['create_date_start']) { |
|
| 313 | $date = $searchData['create_date_start']; |
|
| 314 | $qb |
|
| 315 | ->andWhere('p.create_date >= :create_date_start') |
|
| 316 | ->setParameter('create_date_start', $date); |
|
| 317 | } |
|
| 318 | ||
| 319 | if (!empty($searchData['create_datetime_end']) && $searchData['create_datetime_end']) { |
|
| 320 | $date = $searchData['create_datetime_end']; |
|
| @@ 319-331 (lines=13) @@ | ||
| 316 | ->setParameter('create_date_start', $date); |
|
| 317 | } |
|
| 318 | ||
| 319 | if (!empty($searchData['create_datetime_end']) && $searchData['create_datetime_end']) { |
|
| 320 | $date = $searchData['create_datetime_end']; |
|
| 321 | $qb |
|
| 322 | ->andWhere('p.create_date < :create_date_end') |
|
| 323 | ->setParameter('create_date_end', $date); |
|
| 324 | } elseif (!empty($searchData['create_date_end']) && $searchData['create_date_end']) { |
|
| 325 | $date = clone $searchData['create_date_end']; |
|
| 326 | $date = $date |
|
| 327 | ->modify('+1 days'); |
|
| 328 | $qb |
|
| 329 | ->andWhere('p.create_date < :create_date_end') |
|
| 330 | ->setParameter('create_date_end', $date); |
|
| 331 | } |
|
| 332 | ||
| 333 | // update_date |
|
| 334 | if (!empty($searchData['update_datetime_start']) && $searchData['update_datetime_start']) { |
|
| @@ 334-344 (lines=11) @@ | ||
| 331 | } |
|
| 332 | ||
| 333 | // update_date |
|
| 334 | if (!empty($searchData['update_datetime_start']) && $searchData['update_datetime_start']) { |
|
| 335 | $date = $searchData['update_datetime_start']; |
|
| 336 | $qb |
|
| 337 | ->andWhere('p.update_date >= :update_date_start') |
|
| 338 | ->setParameter('update_date_start', $date); |
|
| 339 | } elseif (!empty($searchData['update_date_start']) && $searchData['update_date_start']) { |
|
| 340 | $date = $searchData['update_date_start']; |
|
| 341 | $qb |
|
| 342 | ->andWhere('p.update_date >= :update_date_start') |
|
| 343 | ->setParameter('update_date_start', $date); |
|
| 344 | } |
|
| 345 | ||
| 346 | if (!empty($searchData['update_datetime_end']) && $searchData['update_datetime_end']) { |
|
| 347 | $date = $searchData['update_datetime_end']; |
|
| @@ 346-358 (lines=13) @@ | ||
| 343 | ->setParameter('update_date_start', $date); |
|
| 344 | } |
|
| 345 | ||
| 346 | if (!empty($searchData['update_datetime_end']) && $searchData['update_datetime_end']) { |
|
| 347 | $date = $searchData['update_datetime_end']; |
|
| 348 | $qb |
|
| 349 | ->andWhere('p.update_date < :update_date_end') |
|
| 350 | ->setParameter('update_date_end', $date); |
|
| 351 | } elseif (!empty($searchData['update_date_end']) && $searchData['update_date_end']) { |
|
| 352 | $date = clone $searchData['update_date_end']; |
|
| 353 | $date = $date |
|
| 354 | ->modify('+1 days'); |
|
| 355 | $qb |
|
| 356 | ->andWhere('p.update_date < :update_date_end') |
|
| 357 | ->setParameter('update_date_end', $date); |
|
| 358 | } |
|
| 359 | ||
| 360 | // Order By |
|
| 361 | $qb |
|