tplconfig.php 512 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. class tplconfig_m extends Model
  3. {
  4. function __construct()
  5. {
  6. parent::Model();
  7. }
  8. function tplconfig_m()
  9. {
  10. $this->__construct();
  11. }
  12. function get_one($id=0,$langid="zh")
  13. {
  14. $sql = "SELECT * FROM ".$this->db->prefix."tpl WHERE status='1'";
  15. if($id)
  16. {
  17. $sql.= " AND id='".$id."' ";
  18. }
  19. else
  20. {
  21. $sql.= " AND (ifdefault='1' OR ifsystem='1') ";
  22. }
  23. $sql .= " AND langid='".$langid."' ";
  24. $sql .= " ORDER BY ifdefault DESC,ifsystem DESC,id DESC";
  25. return $this->db->get_one($sql);
  26. }
  27. }
  28. ?>