Exemple #1
0
 public function get_mail($cond, $fields = " * ")
 {
     //liv_send a  mail_id   liv_mail b id
     $query = "select {$fields} from " . DB_PREFIX . "send a," . DB_PREFIX . "mail b  where 1 AND a.mail_id=b.id {$cond}";
     export_var('query', $query);
     $result = $this->db->query($query);
     $datas = array();
     while ($row = $this->db->fetch_array($result)) {
         $row['create_time'] = date("Y-m-d H:i", $row['create_time']);
         $row['update_time'] = date("Y-m-d H:i", $row['update_time']);
         $datas[$row['id']] = $row;
     }
     return $datas;
 }
Exemple #2
0
 public function get_notice_all($cond, $fields = " * ")
 {
     $query = "select {$fields} from " . DB_PREFIX . "notice_content a where 1  {$cond}";
     export_var('sql1', $query);
     $q = $this->db->query($query);
     $info = array();
     while ($row = $this->db->fetch_array($q)) {
         $row['create_time'] = date("Y-m-d H:i", $row['create_time']);
         $row['update_time'] = date("Y-m-d H:i", $row['update_time']);
         $row['due_time'] = date("Y-m-d H:i", $row['due_time']);
         $info[$row['id']] = $row;
     }
     return $info;
 }
Exemple #3
0
 public function get_rmessages_num($userid)
 {
     $query = "select count(*) as total from " . DB_PREFIX . "message a," . DB_PREFIX . "session b where a.id=b.message_id and b.to_user_id=" . $userid . " and b.state=0";
     export_var('query', $query);
     $q = $this->db->query_first($query);
     return $q;
 }