Changeset 23124 for branches/version-2_13-dev/data/class/SC_SelectSql.php
- Timestamp:
- 2013/08/24 23:33:52 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_13-dev/data/class/SC_SelectSql.php
r22857 r23124 25 25 class SC_SelectSql 26 26 { 27 var$sql;28 29 var$select;30 var$where;31 var$order;32 var$group;33 var$arrSql;34 var$arrVal;27 public $sql; 28 29 public $select; 30 public $where; 31 public $order; 32 public $group; 33 public $arrSql; 34 public $arrVal; 35 35 36 36 //-- コンストラクタ。 37 function __construct($array = '')37 public function __construct($array = '') 38 38 { 39 39 if (is_array($array)) { … … 43 43 44 44 //-- SQL分生成 45 function getSql($mode = '')45 public function getSql($mode = '') 46 46 { 47 47 $this->sql = $this->select .' '. $this->where .' '. $this->group .' '; … … 55 55 56 56 // 検索用 57 function addSearchStr($val)57 public function addSearchStr($val) 58 58 { 59 59 $return = '%' .$val. '%'; … … 63 63 64 64 //-- 範囲検索(○ ~ ○ まで) 65 function selectRange($from, $to, $column)65 public function selectRange($from, $to, $column) 66 66 { 67 67 // ある単位のみ検索($from = $to) … … 87 87 88 88 //-- 期間検索(○年○月○日か~○年○月○日まで) 89 function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column)89 public function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column) 90 90 { 91 91 $return = array(); … … 127 127 128 128 // checkboxなどで同一カラム内で単一、もしくは複数選択肢が有る場合 例: AND ( sex = xxx OR sex = xxx OR sex = xxx) AND ... 129 function setItemTerm($arr, $ItemStr)129 public function setItemTerm($arr, $ItemStr) 130 130 { 131 131 $return = array(); … … 153 153 154 154 // NULL値が必要な場合 155 function setItemTermWithNull($arr, $ItemStr)155 public function setItemTermWithNull($arr, $ItemStr) 156 156 { 157 157 $return = array(); … … 173 173 } 174 174 // NULLもしくは''で検索する場合 175 function setItemTermWithNullAndSpace($arr, $ItemStr)175 public function setItemTermWithNullAndSpace($arr, $ItemStr) 176 176 { 177 177 $return = array(); … … 200 200 201 201 */ 202 function setWhereByOR($arrWhere)202 public function setWhereByOR($arrWhere) 203 203 { 204 204 $count = count($arrWhere); … … 226 226 * @return string WHERE 227 227 */ 228 function getWhere($with_where = false)228 public function getWhere($with_where = false) 229 229 { 230 230 $where = $this->where; … … 237 237 } 238 238 239 function setWhere($where)239 public function setWhere($where) 240 240 { 241 241 if ($where != '') { … … 248 248 } 249 249 250 function setOrder($order)250 public function setOrder($order) 251 251 { 252 252 $this->order = 'ORDER BY ' . $order; 253 253 } 254 254 255 function setGroup($group)255 public function setGroup($group) 256 256 { 257 257 $this->group = 'GROUP BY ' . $group; 258 258 } 259 259 260 function clearSql()260 public function clearSql() 261 261 { 262 262 $this->select = ''; … … 266 266 } 267 267 268 function setSelect($sql)268 public function setSelect($sql) 269 269 { 270 270 $this->select = $sql;
Note: See TracChangeset
for help on using the changeset viewer.