mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
修正一处变量错误
This commit is contained in:
@@ -40,7 +40,7 @@ class HasOne extends OneToOne
|
|||||||
* @param \Closure $closure 闭包查询条件
|
* @param \Closure $closure 闭包查询条件
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function getRelation($subRelation = '', $colsure = null)
|
public function getRelation($subRelation = '', $closure = null)
|
||||||
{
|
{
|
||||||
// 执行关联定义方法
|
// 执行关联定义方法
|
||||||
$localKey = $this->localKey;
|
$localKey = $this->localKey;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ use think\model\Relation;
|
|||||||
|
|
||||||
abstract class OneToOne extends Relation
|
abstract class OneToOne extends Relation
|
||||||
{
|
{
|
||||||
// 预载入方式
|
// 预载入方式 0 -JOIN 1 -IN
|
||||||
protected $eagerlyType = 0;
|
protected $eagerlyType = 0;
|
||||||
// 当前关联的JOIN类型
|
// 当前关联的JOIN类型
|
||||||
protected $joinType;
|
protected $joinType;
|
||||||
@@ -79,8 +79,7 @@ abstract class OneToOne extends Relation
|
|||||||
if ($closure) {
|
if ($closure) {
|
||||||
// 执行闭包查询
|
// 执行闭包查询
|
||||||
call_user_func_array($closure, [ & $query]);
|
call_user_func_array($closure, [ & $query]);
|
||||||
//指定获取关联的字段
|
// 使用withField指定获取关联的字段,如
|
||||||
//需要在 回调中 调方法 withField 方法,如
|
|
||||||
// $query->where(['id'=>1])->withField('id,name');
|
// $query->where(['id'=>1])->withField('id,name');
|
||||||
if ($query->getOptions('with_field')) {
|
if ($query->getOptions('with_field')) {
|
||||||
$field = $query->getOptions('with_field');
|
$field = $query->getOptions('with_field');
|
||||||
|
|||||||
Reference in New Issue
Block a user