mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Add user_name/id as well to CAT
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
class Cat extends CI_Model {
|
||||
|
||||
function update($result, $user_id, $operator) {
|
||||
$this->load->library('Mh');
|
||||
|
||||
$this->load->model('User_model');
|
||||
$timestamp = gmdate("Y-m-d H:i:s");
|
||||
|
||||
if (isset($result['prop_mode'])) {
|
||||
@@ -68,15 +67,19 @@
|
||||
$data['mode_rx'] = NULL;
|
||||
}
|
||||
|
||||
if ($query->num_rows() > 0)
|
||||
{
|
||||
$this->load->library('Mh');
|
||||
$eventdata=$data;
|
||||
$h_user=$this->User_model->get_by_id($user_id);
|
||||
$eventdata['user_name']=$h_user->row()->user_name;
|
||||
$eventdata['user_id']=$h_user->row()->user_id ?? '';
|
||||
if ($query->num_rows() > 0) {
|
||||
// Update the record
|
||||
foreach ($query->result() as $row) {
|
||||
$radio_id = $row->id;
|
||||
$this->db->where('id', $radio_id);
|
||||
$this->db->where('user_id', $user_id);
|
||||
$this->db->update('cat', $data);
|
||||
$this->mh->wl_event('cat/'.$user_id, json_encode($data));
|
||||
$this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata)));
|
||||
}
|
||||
} else {
|
||||
// Add a new record
|
||||
@@ -84,8 +87,10 @@
|
||||
$data['user_id'] = $user_id;
|
||||
$data['operator'] = $operator;
|
||||
$this->db->insert('cat', $data);
|
||||
$this->mh->wl_event('cat/'.$user_id, json_encode($data));
|
||||
$this->mh->wl_event('cat/'.$user_id, json_encode(array_merge($data,$eventdata)));
|
||||
}
|
||||
unset($eventdata);
|
||||
unset($h_user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user