|
楼主 |
发表于 2012-2-10 13:02:59
|
显示全部楼层
比如说这段代码
PHP复制代码
$this->db->select('*,
'.$this->getTablename().'.id as id,
'.$this->getTablename().'.name as name,
'.$this->getTablename().'.ctime as ctime,
'.$this->getTablename().'.mtime as mtime,
category.id as catid,
category.name as catname,
category.ctime as catctime,
category.mtime as catmtime');
$this->db->from($this->getTablename());
if( ! empty($where) && is_array($where))
$this->db->where($where);
$this->db->order_by($this->getTablename().'.ctime', 'DESC');
$this->db->join('category', $this->getTablename().'.category_id = category.id', 'left');
$this->db->limit((int )$limit, (int )$offset);
$products = $this->db->get()->result_array();
复制代码
怎么给数据表用as?
|
|