因此,在注册表中,我想在控制器中进行查询,如果在表单中填写了isg_option_extra_id且未选中isg_options,则删除isg_option_extra_id,因此,如果您首先在注册表单中创建新记录,则会添加该表单但是当您进行编辑时,如果未选中额外选项,它将删除额外选项。如果检查了Extra并填写了extraoption,则一切正常。
我已经尝试过“ = null”,但是我不确定这是否是正确的方法。
$registration= registration::where('isg_rand_id', $rand_id)
->where('isg_distance_id', $distance_id)
->where('isg_category_id', $category_id)
->where('isg_options', '=' , null);
->where('isg_option_extra_id', '=' , $registration_options_extra)
->delete();
Run Code Online (Sandbox Code Playgroud)
我现在收到一条错误消息:
意外的'->'删除。
任何帮助将非常感激!
根据文档,您应该使用whereNull例如。
->whereNull('isg_options')
Run Code Online (Sandbox Code Playgroud)
要摆脱意外错误,请semicolon在此行之后删除:
->where('isg_options', '=' , null); //remove semicolon from here
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
70 次 |
| 最近记录: |