ea
This commit is contained in:
@@ -190,6 +190,15 @@ class ActiveQuery extends QueryTrait implements ISqlBuilder
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toSql(): string
|
||||
{
|
||||
return $this->builder->get();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws
|
||||
|
||||
+999
-952
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,23 @@
|
||||
<?php
|
||||
|
||||
|
||||
use Database\Query;
|
||||
|
||||
class Users extends \Database\Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
public function hasD()
|
||||
{
|
||||
return $this->hasOne(static::class, 'id', 'id')->with([]);
|
||||
}
|
||||
public function hasD()
|
||||
{
|
||||
return $this->hasOne(static::class, 'id', 'id')->with([]);
|
||||
}
|
||||
}
|
||||
|
||||
Users::query()
|
||||
->select(['*', (new Query(Users::class))
|
||||
->where(['id' => 2])])
|
||||
->from(function (Query $query) {
|
||||
$query->from(Users::class)
|
||||
->where(['id' => 1])
|
||||
->groupBy('name DESC');
|
||||
})->toSql();
|
||||
Reference in New Issue
Block a user