$data = request()->param('id');
var_dump($data);
exit;
$update_info = array();
foreach ($data as $key => $value) {
$sql = 'Update cdr SET status = CASE id ';
foreach ($value['data'] as $value_key => $value_value) {
$sql .= ' WHEN ' . $value_value['id'] . ' THEN ' . '1';
}
$sql .= ' END WHERE id IN (';
$sql1 = '';
foreach ($value['data'] as $value_key => $value_value) {
if ($value_value == end($value['data'])) {
$sql1 .= $value_value['id'];
} else {
$sql1 .= $value_value['id'] . ',';
}
}
$sql_end = $sql . $sql1 . ');';
db('cdr')->execute($sql_end);