static public function formatQueryTableAlias($data=null, $table_alias=null, $in_fields=null)
    {
        if ($data && isset($table_alias)) {
            if (is_array($data)) {
                foreach ($data as $k => $v) {
                    if (!is_numeric($k) && strpos($k, '.') === false) {
                        if(isset($in_fields) && !in_array($k, $in_fields)) continue;
                        
                        $data[$table_alias . '.' . $k] = $v;
                        unset($data[$k]);
                    }
                }
            } elseif (strpos($data, ',')) {
                $data = explode(',', $data);
                foreach ($data as $k => $v) {
                    $v = trim($v);
                    if(isset($in_fields) && !in_array($v, $in_fields)) continue;
                    
                    $data[$k] = $table_alias . '.' . $v;
                }
                $data = implode(',', $data);
            } elseif (strpos($data, '.') === false) {
                $data = trim($data);
                if(isset($in_fields) && in_array($data, $in_fields)) {
                    $data = $table_alias . '.' . $data;
                }
            }
        }
        
        return $data;
    }
static public function formatQueryTableAlias($data=null, $table_alias=null, $in_fields=null)
    {
        if ($data && isset($table_alias)) {
            if (is_array($data)) {
                foreach ($data as $k => $v) {
                    if (!is_numeric($k) && strpos($k, '.') === false) {
                        if(isset($in_fields) && !in_array($k, $in_fields)) continue;
                        
                        $data[$table_alias . '.' . $k] = $v;
                        unset($data[$k]);
                    }
                }
            } elseif (strpos($data, ',')) {
                $data = explode(',', $data);
                foreach ($data as $k => $v) {
                    $v = trim($v);
                    if(isset($in_fields) && !in_array($v, $in_fields)) continue;
                    
                    $data[$k] = $table_alias . '.' . $v;
                }
                $data = implode(',', $data);
            } elseif (strpos($data, '.') === false) {
                $data = trim($data);
                if(isset($in_fields) && in_array($data, $in_fields)) {
                    $data = $table_alias . '.' . $data;
                }
            }
        }
        
        return $data;
    }
static public function formatQueryTableAlias ( $ data = null , $ table_alias = null , $ in_fields = null ) { if ( $ data && isset ( $ table_alias ) ) { if ( is_array ( $ data ) ) { foreach ( $ data as $ k => $ v ) { if ( ! is_numeric ( $ k ) && strpos ( $ k , '.' ) === false ) { if ( isset ( $ in_fields ) && ! in_array ( $ k , $ in_fields ) ) continue ; $ data [ $ table_alias . '.' . $ k ] = $ v ; unset ( $ data [ $ k ] ) ; } } } elseif ( strpos ( $ data , ',' ) ) { $ data = explode ( ',' , $ data ) ; foreach ( $ data as $ k => $ v ) { $ v = trim ( $ v ) ; if ( isset ( $ in_fields ) && ! in_array ( $ v , $ in_fields ) ) continue ; $ data [ $ k ] = $ table_alias . '.' . $ v ; } $ data = implode ( ',' , $ data ) ; } elseif ( strpos ( $ data , '.' ) === false ) { $ data = trim ( $ data ) ; if ( isset ( $ in_fields ) && in_array ( $ data , $ in_fields ) ) { $ data = $ table_alias . '.' . $ data ; } } } return $ data ; }
format table alias for fields or where
@param  mixed  $data      array|string
@param  string $table_alias table alias name
@param  array  $in_fields
@return mixed  array|string
format table alias for fields or where