<?php

class Product_model extends CI_Model {

    function __construct() {
        parent::__construct();
        $this->HT = $this->load->database('HT', TRUE);
    }

    //获取用户提供的产品列表
    public function list_by_user($lmi_sn) {
        $sql = "
                SELECT PI_ID,
                       PI_CH_Name,
                       PI_EN_Name,
                       PI_Meno,
                       PI_Phone,
                       PI_Url,
                       PI_TypeID,
                       PI_PictureID,
                       PI_State,
                       PI_AddUser,
                       PI_AddTime
                FROM   SP_ProductInfo
                WHERE  pi_adduser = ?
                ORDER BY
                       pi_id DESC
		";
        $query = $this->HT->query($sql, array($lmi_sn));
        //print_r($this->HT->queries);
        return $query->result();
    }

}
