home.php 794 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. class home_m extends Model
  3. {
  4. var $langid = "zh";
  5. function __construct()
  6. {
  7. parent::Model();
  8. }
  9. function home_m()
  10. {
  11. $this->__construct();
  12. }
  13. function langid($langid="zh")
  14. {
  15. $this->langid = $langid;
  16. }
  17. function get_list_count()
  18. {
  19. $sql = "SELECT count(l.id) total,m.title FROM ".$this->db->prefix."list l JOIN ".$this->db->prefix."module m ON(l.module_id=m.id) ";
  20. $sql.= " WHERE l.status='0' AND l.langid='".$this->langid."' GROUP BY l.module_id ORDER BY m.taxis ASC";
  21. return $this->db->get_all($sql);
  22. }
  23. function get_total()
  24. {
  25. $sql = "SELECT count(id) total FROM ".$this->db->prefix."list";
  26. return $this->db->count($sql);
  27. }
  28. function get_file()
  29. {
  30. $sql = "SELECT count(id) total FROM ".$this->db->prefix."upfiles";
  31. return $this->db->count($sql);
  32. }
  33. }
  34. ?>