|
楼主 |
发表于 2012-7-4 19:34:22
|
显示全部楼层
<?php
class Index_m extends CI_Model
{
function __construct()
{
parent::__construct();
$this->load->database();//载入数据库
}
function get_task()
{
$query = $this->db->get('task');
return $query->result_array();
}
function get_dynamic()
{
$query = $this->db->get('dynamic');
return $query->result_array();
}
function get_article($cid)
{
$this->db->where('cid',$cid);
$query = $this->db->get('article');
return $query->result_array();
}
function get_weekday($lid)
{
$this->db->select('*,sum(hist)');
$this->db->from('weekday');
$this->db->where('lid',$lid);
$this->db->where('week(time)=week(now())');
$this->db->group_by('uid');
$this->db->order_by('sum(hist)','desc');
$query = $this->db->get();
return $query->result_array();
}
}
?> |
|