소스 검색

dev 2020-09

Max F 5 년 전
부모
커밋
92b293f30c
1개의 변경된 파일17개의 추가작업 그리고 2개의 파일을 삭제
  1. 17 2
      src/Database/Sql/WhereQuery.php

+ 17 - 2
src/Database/Sql/WhereQuery.php

@@ -82,6 +82,11 @@ class WhereQuery
 
 
 
+	public function insert($options=[])
+	{
+		return $this->db->getTable($this->table_name)->insert($this->sets, $options);
+	}
+
 	public function update($options=[])
 	{
 		return $this->db->getTable($this->table_name)->update($this->sets, $this->where, $options);
@@ -101,6 +106,12 @@ class WhereQuery
 		return $this->db->getTable($this->table_name)->all($this->where, $options);
 	}
 
+	public function getAll($options=[])
+	{
+		return $this->get($options);
+	}
+
+
 	public function getOne($options=[])
 	{
 		$select = empty($this->selects) ? '*' : $this->selects;
@@ -110,9 +121,13 @@ class WhereQuery
 		return $this->db->getTable($this->table_name)->one($this->where, $options);
 	}
 
-	public function getAll($options=[])
+	public function getCount($options=[])
 	{
-		return $this->get($options);
+		$select = empty($this->selects) ? '*' : $this->selects;
+		if (empty($options['select'])) {
+			$options['select'] = $select;
+		}
+		return $this->db->getTable($this->table_name)->count($this->where, $options);
 	}
 
 	public function getAllWithFoundRows($options=[])