为什么用户的电子邮件会被[电子邮件保护]覆盖?
public function scopeGetList($query)
{
$users = $query->where("account_id",Auth::user()->account_id)
->orderBy('name','asc')
->get(array('id','name','email'));
foreach($users as $user)
{
$data\[$user->id\] = sprintf("%s - %s",$user->name,$user->email);
}
return $data;
}
任何帮助?
答案 0 :(得分:5)
答案 1 :(得分:0)
这些是关于更改为查询scopeGetList
。你必须改成这个:
public function scopeGetList($query)
{
$data = array();
$users = $query->where("account_id",Auth::user()->account_id)
->orderBy('name','asc')
->get();
foreach($users as $user)
{
$data[[$user->id]] = $user['name'] + " - "+ $user['email']);
}
return $data;
}
我希望这对你有所帮助。