protected function getRelationWhere($links, $key = null) {
        if (is_null($key) && !is_array($links)) {
            $key = in_array('id', $this->primaryKey) ? 'id' : reset($this->primaryKey);
        }
        if (!is_array($links)) {
            $links = [$links => $key];
        }
        foreach ($links as &$item) {
            $item = $this->get($item);
        }
        return $links;
    }
protected function getRelationWhere($links, $key = null) {
        if (is_null($key) && !is_array($links)) {
            $key = in_array('id', $this->primaryKey) ? 'id' : reset($this->primaryKey);
        }
        if (!is_array($links)) {
            $links = [$links => $key];
        }
        foreach ($links as &$item) {
            $item = $this->get($item);
        }
        return $links;
    }
protected function getRelationWhere ( $ links , $ key = null ) { if ( is_null ( $ key ) && ! is_array ( $ links ) ) { $ key = in_array ( 'id' , $ this -> primaryKey ) ? 'id' : reset ( $ this -> primaryKey ) ; } if ( ! is_array ( $ links ) ) { $ links = [ $ links => $ key ] ; } foreach ( $ links as & $ item ) { $ item = $ this -> get ( $ item ) ; } return $ links ; }
GET RELATION WHERE SQL
@param string|array $links
@param string $key
@return array
GET RELATION WHERE SQL