swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

Query::table 做分页查询结果被当作是查询单条记录处理 #188

Closed zhouki1117 closed 6 years ago

zhouki1117 commented 6 years ago
Q A
Bug report? yes
Feature request? yes
Swoft version 1.0.0
Swoole version 2.1.1
PHP version 7.1.14
Runtime environment CentOS 6.5

Details

Query::table 做分页查询结果被当作是查询单条记录处理

array(11) {
  ["id"]=>
  string(1)"1"
  ["username"]=>
  string(5) "admin"
  ["password"]=>
  string(32) "91e1d1c76fe0cf08f3de9c8bb738fe7d"
  ["email"]=>
  string(16) "test@test.qq.com"
  ["mobile"]=>
  string(0) ""
  ["create_time"]=>
  string(1) "0"
  ["last_login_time"]=>
  string(1) "0"
  ["update_time"]=>
  string(10) "1522372670"
  ["role_id"]=>
  string(3) "452"
  ["company_id"]=>
  string(1) "0"
  ["if_deleted"]=>
  string(1) "0"
}

Provide minimal script to reproduce the issue

$list = Query::table(User::class, 'u')->leftJoin(Company::class, 'u.company_id = c.id','c')->limit(15, 0)->get(['u.*', 'c.id'])->getResult();
stelin commented 6 years ago

这个问题已经发现了,待会修复。

stelin commented 6 years ago

更新版本,已修复。