Model for User-options
这个提交包含在:
父节点
2891cf09c8
当前提交
5dc5adb4bb
共有 1 个文件被更改,包括 22 次插入 和 0 次删除
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class User_options extends CI_Model
|
||||||
|
{
|
||||||
|
public function options($option_type) {
|
||||||
|
$this->db->where('user_id', $this->session->userdata('user_id'));
|
||||||
|
$this->db->where('option_type', $option_type);
|
||||||
|
return $this->db->get('user_options');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function set_option($option_type, $option_array) {
|
||||||
|
$uid=$this->session->userdata('user_id');
|
||||||
|
$sql='insert into user_options (user_id,option_type,option_key,option_value) values (?,?,?,?) ON DUPLICATE KEY UPDATE option_value=?';
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
foreach ($option_array() as $one_option) {
|
||||||
|
$query = $this->db->query($sql, array($uid, $option_type, $option_key, $option_value, $option_value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
正在加载…
在新工单中引用