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