34 行
无行尾
946 B
PHP
34 行
无行尾
946 B
PHP
<?php
|
|
|
|
class Winkey extends CI_Model
|
|
{
|
|
public function settings($user_id, $station_location_id)
|
|
{
|
|
$this->db->where('user_id', $user_id);
|
|
$this->db->where('station_location_id', $station_location_id);
|
|
$query = $this->db->get('cwmacros');
|
|
|
|
if ($query->num_rows() > 0) {
|
|
return $query->row();
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public function save($data)
|
|
{
|
|
$this->db->where('user_id', $data['user_id']);
|
|
$this->db->where('station_location_id', $data['station_location_id']);
|
|
$query = $this->db->get('cwmacros');
|
|
|
|
if ($query->num_rows() > 0) {
|
|
$this->db->where('user_id', $data['user_id']);
|
|
$this->db->where('station_location_id', $data['station_location_id']);
|
|
$this->db->update('cwmacros', $data);
|
|
} else {
|
|
$this->db->insert('cwmacros', $data);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|