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
|
* @return int
|
||||||
* @throws
|
* @throws
|
||||||
|
|||||||
+999
-952
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
use Database\Query;
|
||||||
|
|
||||||
class Users extends \Database\Model
|
class Users extends \Database\Model
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public function hasD()
|
||||||
|
{
|
||||||
|
return $this->hasOne(static::class, 'id', 'id')->with([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function hasD()
|
Users::query()
|
||||||
{
|
->select(['*', (new Query(Users::class))
|
||||||
return $this->hasOne(static::class, 'id', 'id')->with([]);
|
->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