Closed dhcmega closed 2 years ago
Hi! I think that whereMeta trait should control that the column names "key" and "value" are properly prepended with table name to avoid any case of ambiguity:
->where($this->getMetaTable() . '.key', '=', $key)->where($this->getMetaTable() . '.value', '=', $value)
/** * whereMeta scope for easier join * ------------------------- */ public function scopeWhereMeta($query, $key, $value, $alias = null) { $alias = (empty($alias)) ? $this->getMetaTable() : $alias; return $query->join($this->getMetaTable() . ' AS ' . $alias, $this->getQualifiedKeyName(), '=', $alias . '.' . $this->getMetaKeyName())->where($this->getMetaTable() . '.key', '=', $key)->where($this->getMetaTable() . '.value', '=', $value)->select($this->getTable() . '.*'); }
Hi! I think that whereMeta trait should control that the column names "key" and "value" are properly prepended with table name to avoid any case of ambiguity:
->where($this->getMetaTable() . '.key', '=', $key)->where($this->getMetaTable() . '.value', '=', $value)