ids我尝试从删除多个 id 的概念中选择多个,但收到错误并且 id 未通过
这是我尝试过的代码
<button style="margin-bottom: 10px" class="btn btn-primary delete_all" data-url="{{
url('receiveAllUnit') }}">Received All</button>
$(document).ready(function () {
$('#master').on('click', function(e) {
if($(this).is(':checked',true))
{
$(".sub_chk").prop('checked', true);
} else {
$(".sub_chk").prop('checked',false);
}
});
$('.delete_all').on('click', function(e) {
var allVals = [];
$(".sub_chk:checked").each(function() {
allVals.push($(this).attr('data-id'));
});
if(allVals.length <=0)
{
alert("Please select row.");
} else {
var check = confirm("Are you sure you want to Receive All Units?");
if(check == true){
var join_selected_values = allVals.join(",");
请告诉我如何获取这些 id 并将其传递给控制器
我希望更新这样的一栏
RotateDevice::whereIn([ ['DeviceId',$ids]
])
->update([
'status'=>0,
]);
郎朗坤
相关分类