Exemplo n.º 1
0
 /**
  * 编译select语句
  *
  * @param  CatLib\Database\Grammars\Builder  $query
  * @return string
  */
 public function compileSelect(Builder $query)
 {
     $sql = parent::compileSelect($query);
     if ($query->unions) {
         $sql = '(' . $sql . ') ' . $this->compileUnions($query);
     }
     return $sql;
 }
Exemplo n.º 2
0
 /**
  * 转化为sql语句
  *
  * @return string
  */
 public function toSql()
 {
     return $this->grammar->compileSelect($this);
 }