|
|
|
@ -152,9 +152,16 @@ class AgentController extends AdminController |
|
|
|
$form->editor('agentInfo.reg_protocol', '注册协议'); |
|
|
|
$form->editor('agentInfo.buy_protocol', '购买协议'); |
|
|
|
})->saving(function (Form $form) { |
|
|
|
//判断账号是否唯一
|
|
|
|
if ($form->isCreating()) { |
|
|
|
if ($form->repository()->model()->where('account', $form->account)->exists()) { |
|
|
|
return $form->response()->error($form->account . ' 的账号已经存在'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//不允许编辑的字段
|
|
|
|
if ($form->isEditing()) { |
|
|
|
$form->ignore(['id', 'account', 'created_at', 'updated_at']); |
|
|
|
$form->ignore(['id', 'account', 'created_at', 'updated_at', 'deleted_at']); |
|
|
|
} |
|
|
|
|
|
|
|
//过滤null字段
|
|
|
|
|