我有一个员工表格编辑。我的问题是,我的编辑功能运行良好,但我无法获取员工类型的值。
我有 4 种员工类型:
职员
导师
经理
超级用户
每次我去编辑表单时,下拉列表中的员工类型总是在员工上(我想显示,如果员工是“经理”,那么下拉框显示经理)。
这是editroledetails.blade.php的代码
<div class="form-group">
<label for="editCustomerType">Customer Type</label><br/>
<select name="editCustomerType">
<option value="Staff">Staff</option>
<option value="Supervisor">Supervisor</option>
<option value="Manager">Manager</option>
<option value="Super User">Super User</option>
</select>
</div>
控制器功能
public function editroledetails(Request $request)
{
$user = \Auth::user();
$userphone = 0;
$reportTo = DB::select(DB::raw("select username from customer_type where customer_type = 'Supervisor' or customer_type ='Manager' "));
$select = DB::select(DB::raw("select customer_type from customer_type "));
$data = [
'editUsername' => $request->editUsername,
'editNik' => $request->editNik,
'editEmail' => $request->editEmail,
'editRegIdentities' => $request->editRegIdentities,
'editReportTo' => $request->editReportTo,
'editID' => $request->editID
];
return view('editroledetails', compact('user', 'userphone', 'data', 'reportTo', 'select'));
}
慕容3067478
交互式爱情
牛魔王的故事