| @@ 138-149 (lines=12) @@ | ||
| 135 | }  | 
                                |
| 136 | ||
| 137 | // birth  | 
                                |
| 138 |         if (!empty($searchData['birth_start']) && $searchData['birth_start']) { | 
                                |
| 139 |             if (!$joinedCustomer) { | 
                                |
| 140 |                 $qb->leftJoin('o.Customer', 'c'); | 
                                |
| 141 | $joinedCustomer = true;  | 
                                |
| 142 | }  | 
                                |
| 143 | ||
| 144 | $date = $searchData['birth_start']  | 
                                |
| 145 |                 ->format('Y-m-d H:i:s'); | 
                                |
| 146 | $qb  | 
                                |
| 147 |                 ->andWhere('c.birth >= :birth_start') | 
                                |
| 148 |                 ->setParameter('birth_start', $date); | 
                                |
| 149 | }  | 
                                |
| 150 |         if (!empty($searchData['birth_end']) && $searchData['birth_end']) { | 
                                |
| 151 |             if (!$joinedCustomer) { | 
                                |
| 152 |                 $qb->leftJoin('o.Customer', 'c'); | 
                                |
| @@ 150-163 (lines=14) @@ | ||
| 147 |                 ->andWhere('c.birth >= :birth_start') | 
                                |
| 148 |                 ->setParameter('birth_start', $date); | 
                                |
| 149 | }  | 
                                |
| 150 |         if (!empty($searchData['birth_end']) && $searchData['birth_end']) { | 
                                |
| 151 |             if (!$joinedCustomer) { | 
                                |
| 152 |                 $qb->leftJoin('o.Customer', 'c'); | 
                                |
| 153 | $joinedCustomer = true;  | 
                                |
| 154 | }  | 
                                |
| 155 | ||
| 156 | $date = clone $searchData['birth_end'];  | 
                                |
| 157 | $date = $date  | 
                                |
| 158 |                 ->modify('+1 days') | 
                                |
| 159 |                 ->format('Y-m-d H:i:s'); | 
                                |
| 160 | $qb  | 
                                |
| 161 |                 ->andWhere('c.birth < :birth_end') | 
                                |
| 162 |                 ->setParameter('birth_end', $date); | 
                                |
| 163 | }  | 
                                |
| 164 | ||
| 165 | // sex  | 
                                |
| 166 |         if (!empty($searchData['sex']) && count($searchData['sex']) > 0) { | 
                                |