tpl.php 640 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. class tpl_m extends Model
  3. {
  4. var $langid = "zh";
  5. function __construct()
  6. {
  7. parent::Model();
  8. }
  9. function tpl_m()
  10. {
  11. $this->__construct();
  12. }
  13. function set_langid($langid="zh")
  14. {
  15. $this->langid = $langid;
  16. }
  17. function get_one($id)
  18. {
  19. $sql = "SELECT * FROM ".$this->db->prefix."tpl WHERE id='".$id."'";
  20. return $this->db->get_one($sql);
  21. }
  22. //取得模板列表
  23. function get_list($langid="zh",$status=0)
  24. {
  25. $sql = "SELECT * FROM ".$this->db->prefix."tpl WHERE langid='".$langid."' ";
  26. if($status)
  27. {
  28. $sql.= " AND status='1' ";
  29. }
  30. $sql.= " ORDER BY taxis ASC,id DESC ";
  31. return $this->db->get_all($sql);
  32. }
  33. }
  34. ?>