**已关闭。**此问题不可复制或由打字错误引起。它目前不接受答案。
**想要改进此问题?**更新问题,使其位于堆栈溢出主题上。
两天前关门了。
改进这个问题
我不知道为什么会收到“datatables警告:table id=report\u table-无效json响应”。有关此错误的详细信息,请参阅http://datatables.net/tn/1 一切正常数据返回正常,但未显示在数据表中,此错误弹出,即使在网络选项卡中也没有错误
$raw_qry = "SELECT `order`.id as order_no,`order`.order_date,users.first_name,users.last_name,`order`.`discount_amount`,`order`.`sub_total`,`order`.total,order_type.type, order_resources.resource_name,order_status.name from `order` join users on users.id=`order`.user_id join order_type on order_type.id=`order`.`order_type_id` join order_resources on order_resources.id=`order`.`order_resource` join order_Status on order_status.id=`order`.`status_id` join restaurant_branch on restaurant_branch.id=`order`.restaurant_branch_id WHERE 1 $wh AND Date(`order`.`order_date`) BETWEEN '$start_date' AND '$end_date' AND `order`.`status_id` <> 8 order by `order`.id asc";
$qry_result = DB::select( DB::raw($raw_qry) );
$recordsTotal = $recordsFiltered = count($qry_result);
$qry_result = DB::select( DB::raw($raw_qry. $limit) );
}
$resp = array();
$i = 0;
foreach($qry_result as $item)
{
$resp[$i][0] = $item->order_no;
$resp[$i][1] = $item->order_date;
$resp[$i][2] = $item->first_name."".$item->last_name;
$resp[$i][3] = $item->discount_amount;
$resp[$i][4] = $item->sub_total;
$resp[$i][5] = $item->total;
$resp[$i][6] = $item->type;
$resp[$i][7] = $item->resource_name;
$resp[$i][8] = $item->name;
$i +=1;
}
$data = array(
'draw' => $draw,
'recordsTotal' => $recordsTotal,
'recordsFiltered' => $recordsFiltered,
'data' => $resp
);
return json_encode($data,true);
暂无答案!
目前还没有任何答案,快来回答吧!