lib/db/cortex.php
protected function _hasJoin_sql($key, $table, $cond, &$filter, &$options) {
		$relConf = $this->fieldConf[$key]['belongs-to-one'];
		$relModel = is_array($relConf)?$relConf[0]:$relConf;
		$rel = $this->getRelInstance($relModel,null,$key);
		$fkey = is_array($this->fieldConf[$key]['belongs-to-one']) ?
			$this->fieldConf[$key]['belongs-to-one'][1] : $rel->primary;
		$alias = $table.'__'.$key;
		$query = $this->_sql_left_join($key,$this->table,$fkey,[$table,$alias]);
		$this->_sql_mergeRelCondition($cond,$alias,$filter,$options);
		return $query;
	}
protected function _hasJoin_sql($key, $table, $cond, &$filter, &$options) {
		$relConf = $this->fieldConf[$key]['belongs-to-one'];
		$relModel = is_array($relConf)?$relConf[0]:$relConf;
		$rel = $this->getRelInstance($relModel,null,$key);
		$fkey = is_array($this->fieldConf[$key]['belongs-to-one']) ?
			$this->fieldConf[$key]['belongs-to-one'][1] : $rel->primary;
		$alias = $table.'__'.$key;
		$query = $this->_sql_left_join($key,$this->table,$fkey,[$table,$alias]);
		$this->_sql_mergeRelCondition($cond,$alias,$filter,$options);
		return $query;
	}
protected function _hasJoin_sql ( $ key , $ table , $ cond , & $ filter , & $ options ) { $ relConf = $ this -> fieldConf [ $ key ] [ 'belongs-to-one' ] ; $ relModel = is_array ( $ relConf ) ? $ relConf [ 0 ] : $ relConf ; $ rel = $ this -> getRelInstance ( $ relModel , null , $ key ) ; $ fkey = is_array ( $ this -> fieldConf [ $ key ] [ 'belongs-to-one' ] ) ? $ this -> fieldConf [ $ key ] [ 'belongs-to-one' ] [ 1 ] : $ rel -> primary ; $ alias = $ table . '__' . $ key ; $ query = $ this -> _sql_left_join ( $ key , $ this -> table , $ fkey , [ $ table , $ alias ] ) ; $ this -> _sql_mergeRelCondition ( $ cond , $ alias , $ filter , $ options ) ; return $ query ; }
build query for single SQL table join and merge conditions
build query for single SQL table join and merge conditions