echo $slot->id;
$slot->players = (Model_Players::find(function ($query)
{
return $query->join('users')
->on('players.player', '=', 'users.id')
->where('players.slot', $slot->id);
})) ?: array();
回报:
4
ErrorException [ Notice ]: Undefined variable: slot
APPPATH/classes/controller/booking.php @ line 98:
98: ->where('players.slot', $slot->id);
如何将$slot
对象发送到函数中?