You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[8.x] apply where's from union query builder in cursor pagination (#42651)
* [8.x] apply where's from union query builder in cursor pagination
* fixed Property [unions] does not exist on the Eloquent builder instance.
* apply StyleCI fixes
Co-authored-by: Stefan Heimann <[email protected]>
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results, $ts) {
4051
+
$this->assertEquals(
4052
+
'(select "id", "start_time" as "created_at", \'video\' as type from "videos" where ("start_time" > ?)) union (select "id", "created_at", \'news\' as type from "news" where ("start_time" > ?)) order by "created_at" asc limit 17',
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results, $ts) {
4097
+
$this->assertEquals(
4098
+
'(select "id", "is_published", "start_time" as "created_at", \'video\' as type from "videos" where "is_published" = ? and ("start_time" > ?)) union (select "id", "is_published", "created_at", \'news\' as type from "news" where "is_published" = ? and ("start_time" > ?)) order by case when (id = 3 and type="news" then 0 else 1 end), "created_at" asc limit 17',
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results, $ts) {
4143
+
$this->assertEquals(
4144
+
'(select "id", "start_time" as "created_at", \'video\' as type from "videos" where ("start_time" < ?)) union (select "id", "created_at", \'news\' as type from "news" where ("start_time" < ?)) order by "created_at" asc limit 17',
$builder->shouldReceive('get')->once()->andReturnUsing(function () use ($builder, $results, $ts) {
4189
+
$this->assertEquals(
4190
+
'(select "id", "start_time" as "created_at", \'video\' as type from "videos" where ("start_time" < ? or ("start_time" = ? and ("id" > ?)))) union (select "id", "created_at", \'news\' as type from "news" where ("start_time" < ? or ("start_time" = ? and ("id" > ?)))) order by "created_at" desc, "id" asc limit 17',
0 commit comments