变更
This commit is contained in:
+9
-9
@@ -37,14 +37,14 @@ abstract class HasBase implements \Database\Traits\Relation
|
|||||||
/** @var Relation $_relation */
|
/** @var Relation $_relation */
|
||||||
protected Relation $_relation;
|
protected Relation $_relation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HasBase constructor.
|
* HasBase constructor.
|
||||||
* @param ModelInterface $model
|
* @param ModelInterface $model
|
||||||
* @param $primaryId
|
* @param $primaryId
|
||||||
* @param $value
|
* @param $value
|
||||||
* @param Relation $relation
|
* @param Relation $relation
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function __construct(mixed $model, $primaryId, $value, Relation $relation)
|
public function __construct(mixed $model, $primaryId, $value, Relation $relation)
|
||||||
{
|
{
|
||||||
if (!class_exists($model)) {
|
if (!class_exists($model)) {
|
||||||
@@ -60,7 +60,7 @@ abstract class HasBase implements \Database\Traits\Relation
|
|||||||
$_model = $model::query()->where(['t1.' . $primaryId => $value]);
|
$_model = $model::query()->where(['t1.' . $primaryId => $value]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_relation = $relation->bindIdentification($model, $_model);
|
$this->_relation = $relation->bindIdentification($model . '_' . $primaryId . '_' . $value, $_model);
|
||||||
|
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user