Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缓存命中跟不命中情况下返回类型不同,产生问题 #16

Open
dryyun opened this issue Dec 7, 2016 · 0 comments
Open

Comments

@dryyun
Copy link

dryyun commented Dec 7, 2016

Angejia\Pea\QueryBuilder 继承 Illuminate\Database\Query\Builder ,覆盖了 get() 方法

如果命中了缓存,返回的是数组对象 stdClass Object
如果没有命中,返回的是 Illuminate\Support\Collection Object

不同类型的返回结果,对后续的处理是有问题的。

Illuminate\Database\Eloquent\Builder:: getModels() 就有使用 get() 的结果

$results = $this->query->get($columns)->all();

所以在命中的时候,就会报错

Call to a member function all() on array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant