public function join($table, $field1 = null, $op = null, $field2 = null, $type = '')
{
$on = $field1;
$table = $this->prefix . $table;
if (!is_null($op)) {
$on = !in_array($op, $this->op) ? $this->prefix . $field1 . ' = ' . $this->prefix . $op : $this->prefix . $field1 . ' ' . $op . ' ' . $this->prefix . $field2;
}
if (is_null($this->join)) {
$this->join = ' ' . $type . 'JOIN' . ' ' . $table . ' ON ' . $on;
} else {
$this->join = $this->join . ' ' . $type . 'JOIN' . ' ' . $table . ' ON ' . $on;
}
return $this;
}