feat : role
This commit is contained in:
@@ -56,4 +56,27 @@ class AdminRole extends Model
|
||||
{
|
||||
return $this->where('name', $name)->first();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取批量数据
|
||||
* @param $ids
|
||||
* @return array
|
||||
*/
|
||||
public function getDataByIds($ids)
|
||||
{
|
||||
$data = $this->whereIn('id', $ids)->get();
|
||||
if (empty($data)){
|
||||
return [];
|
||||
}
|
||||
|
||||
$res = [];
|
||||
foreach ($data->toArray() as $one)
|
||||
{
|
||||
$res[$one['id']] = $one;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user