| @@ 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 (isset($searchData['buy_times_start']) && StringUtil::isNotBlank($searchData['buy_times_start'])) { |
|
| @@ 175-179 (lines=5) @@ | ||
| 172 | } |
|
| 173 | ||
| 174 | // buy_times |
|
| 175 | if (isset($searchData['buy_times_start']) && StringUtil::isNotBlank($searchData['buy_times_start'])) { |
|
| 176 | $qb |
|
| 177 | ->andWhere('c.buy_times >= :buy_times_start') |
|
| 178 | ->setParameter('buy_times_start', $searchData['buy_times_start']); |
|
| 179 | } |
|
| 180 | if (isset($searchData['buy_times_end']) && StringUtil::isNotBlank($searchData['buy_times_end'])) { |
|
| 181 | $qb |
|
| 182 | ->andWhere('c.buy_times <= :buy_times_end') |
|
| @@ 180-184 (lines=5) @@ | ||
| 177 | ->andWhere('c.buy_times >= :buy_times_start') |
|
| 178 | ->setParameter('buy_times_start', $searchData['buy_times_start']); |
|
| 179 | } |
|
| 180 | if (isset($searchData['buy_times_end']) && StringUtil::isNotBlank($searchData['buy_times_end'])) { |
|
| 181 | $qb |
|
| 182 | ->andWhere('c.buy_times <= :buy_times_end') |
|
| 183 | ->setParameter('buy_times_end', $searchData['buy_times_end']); |
|
| 184 | } |
|
| 185 | ||
| 186 | // create_date |
|
| 187 | if (!empty($searchData['create_date_start']) && $searchData['create_date_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'); |
|
| @@ 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; |
|
| @@ 144-148 (lines=5) @@ | ||
| 141 | } |
|
| 142 | ||
| 143 | // company_name |
|
| 144 | if (isset($searchData['company_name']) && StringUtil::isNotBlank($searchData['company_name'])) { |
|
| 145 | $qb |
|
| 146 | ->andWhere('o.company_name LIKE :company_name') |
|
| 147 | ->setParameter('company_name', '%'.$searchData['company_name'].'%'); |
|
| 148 | } |
|
| 149 | ||
| 150 | // name |
|
| 151 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| @@ 151-155 (lines=5) @@ | ||
| 148 | } |
|
| 149 | ||
| 150 | // name |
|
| 151 | if (isset($searchData['name']) && StringUtil::isNotBlank($searchData['name'])) { |
|
| 152 | $qb |
|
| 153 | ->andWhere('CONCAT(o.name01, o.name02) LIKE :name') |
|
| 154 | ->setParameter('name', '%'.$searchData['name'].'%'); |
|
| 155 | } |
|
| 156 | ||
| 157 | // kana |
|
| 158 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| @@ 158-162 (lines=5) @@ | ||
| 155 | } |
|
| 156 | ||
| 157 | // kana |
|
| 158 | if (isset($searchData['kana']) && StringUtil::isNotBlank($searchData['kana'])) { |
|
| 159 | $qb |
|
| 160 | ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana') |
|
| 161 | ->setParameter('kana', '%'.$searchData['kana'].'%'); |
|
| 162 | } |
|
| 163 | ||
| 164 | ||
| 165 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| @@ 165-169 (lines=5) @@ | ||
| 162 | } |
|
| 163 | ||
| 164 | ||
| 165 | if (isset($searchData['email']) && StringUtil::isNotBlank($searchData['email'])) { |
|
| 166 | $qb |
|
| 167 | ->andWhere('o.email like :email') |
|
| 168 | ->setParameter('email', '%'.$searchData['email'].'%'); |
|
| 169 | } |
|
| 170 | ||
| 171 | // tel |
|
| 172 | if (isset($searchData['phone_number']) && StringUtil::isNotBlank($searchData['phone_number'])) { |
|
| @@ 247-251 (lines=5) @@ | ||
| 244 | } |
|
| 245 | ||
| 246 | // payment_total |
|
| 247 | if (isset($searchData['payment_total_start']) && StringUtil::isNotBlank($searchData['payment_total_start'])) { |
|
| 248 | $qb |
|
| 249 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 250 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 251 | } |
|
| 252 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 253 | $qb |
|
| 254 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| @@ 252-256 (lines=5) @@ | ||
| 249 | ->andWhere('o.payment_total >= :payment_total_start') |
|
| 250 | ->setParameter('payment_total_start', $searchData['payment_total_start']); |
|
| 251 | } |
|
| 252 | if (isset($searchData['payment_total_end']) && StringUtil::isNotBlank($searchData['payment_total_end'])) { |
|
| 253 | $qb |
|
| 254 | ->andWhere('o.payment_total <= :payment_total_end') |
|
| 255 | ->setParameter('payment_total_end', $searchData['payment_total_end']); |
|
| 256 | } |
|
| 257 | ||
| 258 | // buy_product_name |
|
| 259 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| @@ 259-263 (lines=5) @@ | ||
| 256 | } |
|
| 257 | ||
| 258 | // buy_product_name |
|
| 259 | if (isset($searchData['buy_product_name']) && StringUtil::isNotBlank($searchData['buy_product_name'])) { |
|
| 260 | $qb |
|
| 261 | ->andWhere('oi.product_name LIKE :buy_product_name') |
|
| 262 | ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%'); |
|
| 263 | } |
|
| 264 | ||
| 265 | // 発送メール送信/未送信. |
|
| 266 | if (isset($searchData['shipping_mail']) && $count = count($searchData['shipping_mail'])) { |
|