| @@ 162-166 (lines=5) @@ | ||
| 159 | } |
|
| 160 | ||
| 161 | // buy_total |
|
| 162 | if (isset($searchData['buy_total_start']) && StringUtil::isNotBlank($searchData['buy_total_start'])) { |
|
| 163 | $qb |
|
| 164 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 165 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 166 | } |
|
| 167 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 168 | $qb |
|
| 169 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| @@ 167-171 (lines=5) @@ | ||
| 164 | ->andWhere('c.buy_total >= :buy_total_start') |
|
| 165 | ->setParameter('buy_total_start', $searchData['buy_total_start']); |
|
| 166 | } |
|
| 167 | if (isset($searchData['buy_total_end']) && StringUtil::isNotBlank($searchData['buy_total_end'])) { |
|
| 168 | $qb |
|
| 169 | ->andWhere('c.buy_total <= :buy_total_end') |
|
| 170 | ->setParameter('buy_total_end', $searchData['buy_total_end']); |
|
| 171 | } |
|
| 172 | ||
| 173 | // buy_times |
|
| 174 | if (isset($searchData['buy_times_start']) && StringUtil::isNotBlank($searchData['buy_times_start'])) { |
|
| @@ 174-178 (lines=5) @@ | ||
| 171 | } |
|
| 172 | ||
| 173 | // buy_times |
|
| 174 | if (isset($searchData['buy_times_start']) && StringUtil::isNotBlank($searchData['buy_times_start'])) { |
|
| 175 | $qb |
|
| 176 | ->andWhere('c.buy_times >= :buy_times_start') |
|
| 177 | ->setParameter('buy_times_start', $searchData['buy_times_start']); |
|
| 178 | } |
|
| 179 | if (isset($searchData['buy_times_end']) && StringUtil::isNotBlank($searchData['buy_times_end'])) { |
|
| 180 | $qb |
|
| 181 | ->andWhere('c.buy_times <= :buy_times_end') |
|
| @@ 179-183 (lines=5) @@ | ||
| 176 | ->andWhere('c.buy_times >= :buy_times_start') |
|
| 177 | ->setParameter('buy_times_start', $searchData['buy_times_start']); |
|
| 178 | } |
|
| 179 | if (isset($searchData['buy_times_end']) && StringUtil::isNotBlank($searchData['buy_times_end'])) { |
|
| 180 | $qb |
|
| 181 | ->andWhere('c.buy_times <= :buy_times_end') |
|
| 182 | ->setParameter('buy_times_end', $searchData['buy_times_end']); |
|
| 183 | } |
|
| 184 | ||
| 185 | // create_date |
|
| 186 | if (!empty($searchData['create_datetime_start']) && $searchData['create_datetime_start']) { |
|
| @@ 88-92 (lines=5) @@ | ||
| 85 | ->innerJoin('o.Shippings', 's'); |
|
| 86 | ||
| 87 | // order_id_start |
|
| 88 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 89 | $qb |
|
| 90 | ->andWhere('o.id = :order_id') |
|
| 91 | ->setParameter('order_id', $searchData['order_id']); |
|
| 92 | } |
|
| 93 | ||
| 94 | // order_no |
|
| 95 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| @@ 95-99 (lines=5) @@ | ||
| 92 | } |
|
| 93 | ||
| 94 | // order_no |
|
| 95 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| 96 | $qb |
|
| 97 | ->andWhere('o.order_no = :order_no') |
|
| 98 | ->setParameter('order_no', $searchData['order_no']); |
|
| 99 | } |
|
| 100 | ||
| 101 | // order_id_start |
|
| 102 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| @@ 102-106 (lines=5) @@ | ||
| 99 | } |
|
| 100 | ||
| 101 | // order_id_start |
|
| 102 | if (isset($searchData['order_id_start']) && StringUtil::isNotBlank($searchData['order_id_start'])) { |
|
| 103 | $qb |
|
| 104 | ->andWhere('o.id >= :order_id_start') |
|
| 105 | ->setParameter('order_id_start', $searchData['order_id_start']); |
|
| 106 | } |
|
| 107 | // multi |
|
| 108 | if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 109 | $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 119-123 (lines=5) @@ | ||
| 116 | } |
|
| 117 | ||
| 118 | // order_id_end |
|
| 119 | if (isset($searchData['order_id_end']) && StringUtil::isNotBlank($searchData['order_id_end'])) { |
|
| 120 | $qb |
|
| 121 | ->andWhere('o.id <= :order_id_end') |
|
| 122 | ->setParameter('order_id_end', $searchData['order_id_end']); |
|
| 123 | } |
|
| 124 | ||
| 125 | // status |
|
| 126 | $filterStatus = false; |
|
| @@ 141-145 (lines=5) @@ | ||
| 138 | } |
|
| 139 | ||
| 140 | // company_name |
|
| 141 | if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) { |
|
| 142 | $qb |
|
| 143 | ->andWhere('o.company_name LIKE :company_name') |
|
| 144 | ->setParameter('company_name', '%'.$searchData['company_name'].'%'); |
|
| 145 | } |
|
| 146 | ||
| 147 | // name |
|
| 148 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 148-152 (lines=5) @@ | ||
| 145 | } |
|
| 146 | ||
| 147 | // name |
|
| 148 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 149 | $qb |
|
| 150 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 151 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 152 | } |
|
| 153 | ||
| 154 | // kana |
|
| 155 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 155-159 (lines=5) @@ | ||
| 152 | } |
|
| 153 | ||
| 154 | // kana |
|
| 155 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 156 | $qb |
|
| 157 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 158 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 159 | } |
|
| 160 | ||
| 161 | ||
| 162 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 162-166 (lines=5) @@ | ||
| 159 | } |
|
| 160 | ||
| 161 | ||
| 162 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 163 | $qb |
|
| 164 | ->andWhere('o.email like :email') |
|
| 165 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 166 | } |
|
| 167 | ||
| 168 | // tel |
|
| 169 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 277-281 (lines=5) @@ | ||
| 274 | } |
|
| 275 | ||
| 276 | // payment_total |
|
| 277 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 278 | $qb |
|
| 279 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 280 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 281 | } |
|
| 282 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 283 | $qb |
|
| 284 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 282-286 (lines=5) @@ | ||
| 279 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 280 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 281 | } |
|
| 282 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 283 | $qb |
|
| 284 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 285 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 286 | } |
|
| 287 | ||
| 288 | // buy_product_name |
|
| 289 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 289-293 (lines=5) @@ | ||
| 286 | } |
|
| 287 | ||
| 288 | // buy_product_name |
|
| 289 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 290 | $qb |
|
| 291 | ->andWhere('oi.product_name LIKE :buy_product_name') |
|
| 292 | ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 293 | } |
|
| 294 | ||
| 295 | // 発送メール送信/未送信. |
|
| 296 | if (isset($searchData['shipping_mail']) && $count = count($searchData['shipping_mail'])) { |
|
| @@ 50-54 (lines=5) @@ | ||
| 47 | $qb->leftJoin('s.OrderItems', 'si') |
|
| 48 | ->leftJoin('si.Order', 'o'); |
|
| 49 | // order_id_start |
|
| 50 | if (isset($searchData['shipping_id_start']) && StringUtil::isNotBlank($searchData['shipping_id_start'])) { |
|
| 51 | $qb |
|
| 52 | ->andWhere('s.id >= :shipping_id_start') |
|
| 53 | ->setParameter('shipping_id_start', $searchData['shipping_id_start']); |
|
| 54 | } |
|
| 55 | // multi |
|
| 56 | if (isset($searchData['multi']) && StringUtil::isNotBlank($searchData['multi'])) { |
|
| 57 | $multi = preg_match('/^\d{0,10}$/', $searchData['multi']) ? $searchData['multi'] : null; |
|
| @@ 66-70 (lines=5) @@ | ||
| 63 | } |
|
| 64 | ||
| 65 | // shipping_id_end |
|
| 66 | if (isset($searchData['shipping_id_end']) && StringUtil::isNotBlank($searchData['shipping_id_end'])) { |
|
| 67 | $qb |
|
| 68 | ->andWhere('s.id <= :shipping_id_end') |
|
| 69 | ->setParameter('shipping_id_end', $searchData['shipping_id_end']); |
|
| 70 | } |
|
| 71 | ||
| 72 | // order_id |
|
| 73 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| @@ 73-77 (lines=5) @@ | ||
| 70 | } |
|
| 71 | ||
| 72 | // order_id |
|
| 73 | if (isset($searchData['order_id']) && StringUtil::isNotBlank($searchData['order_id'])) { |
|
| 74 | $qb |
|
| 75 | ->andWhere('o.id = :order_id') |
|
| 76 | ->setParameter('order_id', $searchData['order_id']); |
|
| 77 | } |
|
| 78 | ||
| 79 | // order_no |
|
| 80 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| @@ 80-84 (lines=5) @@ | ||
| 77 | } |
|
| 78 | ||
| 79 | // order_no |
|
| 80 | if (isset($searchData['order_no']) && StringUtil::isNotBlank($searchData['order_no'])) { |
|
| 81 | $qb |
|
| 82 | ->andWhere('o.order_no LIKE :order_no') |
|
| 83 | ->setParameter('order_no', "%{$searchData['order_no']}%"); |
|
| 84 | } |
|
| 85 | ||
| 86 | // order status |
|
| 87 | if (isset($searchData['order_status']) && count($searchData['order_status'])) { |
|
| @@ 94-98 (lines=5) @@ | ||
| 91 | ->setParameter('order_status', $searchData['order_status']); |
|
| 92 | } |
|
| 93 | // name |
|
| 94 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 95 | $qb |
|
| 96 | ->andWhere('CONCAT(s.name01, s.name02) LIKE :name') |
|
| 97 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 98 | } |
|
| 99 | ||
| 100 | // kana |
|
| 101 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 101-105 (lines=5) @@ | ||
| 98 | } |
|
| 99 | ||
| 100 | // kana |
|
| 101 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 102 | $qb |
|
| 103 | ->andWhere('CONCAT(s.kana01, s.kana02) LIKE :kana') |
|
| 104 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 105 | } |
|
| 106 | ||
| 107 | // order_name |
|
| 108 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| @@ 108-112 (lines=5) @@ | ||
| 105 | } |
|
| 106 | ||
| 107 | // order_name |
|
| 108 | if (isset($searchData['order_name']) && StringUtil::isNotBlank($searchData['order_name'])) { |
|
| 109 | $qb |
|
| 110 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :order_name') |
|
| 111 | ->setParameter('order_name', '%'.$searchData['order_name'].'%'); |
|
| 112 | } |
|
| 113 | ||
| 114 | // order_kana |
|
| 115 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| @@ 115-119 (lines=5) @@ | ||
| 112 | } |
|
| 113 | ||
| 114 | // order_kana |
|
| 115 | if (isset($searchData['order_kana']) && StringUtil::isNotBlank($searchData['order_kana'])) { |
|
| 116 | $qb |
|
| 117 | ->andWhere('CONCAT(o.kana01, s.kana02) LIKE :order_kana') |
|
| 118 | ->setParameter('order_kana', '%'.$searchData['order_kana'].'%'); |
|
| 119 | } |
|
| 120 | ||
| 121 | // order_email |
|
| 122 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 122-126 (lines=5) @@ | ||
| 119 | } |
|
| 120 | ||
| 121 | // order_email |
|
| 122 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 123 | $qb |
|
| 124 | ->andWhere('o.email like :email') |
|
| 125 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 126 | } |
|
| 127 | ||
| 128 | // tel |
|
| 129 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 213-217 (lines=5) @@ | ||
| 210 | } |
|
| 211 | ||
| 212 | // payment_total |
|
| 213 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 214 | $qb |
|
| 215 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 216 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 217 | } |
|
| 218 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 219 | $qb |
|
| 220 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 218-222 (lines=5) @@ | ||
| 215 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 216 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 217 | } |
|
| 218 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 219 | $qb |
|
| 220 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 221 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 222 | } |
|
| 223 | ||
| 224 | // buy_product_name |
|
| 225 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 225-229 (lines=5) @@ | ||
| 222 | } |
|
| 223 | ||
| 224 | // buy_product_name |
|
| 225 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 226 | $qb |
|
| 227 | ->andWhere('si.product_name LIKE :buy_product_name') |
|
| 228 | ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 229 | } |
|
| 230 | ||
| 231 | // Order By |
|
| 232 | $qb->orderBy('s.update_date', 'DESC'); |
|