recommend.php 860 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. class recommend_m extends Model
  3. {
  4. function __construct()
  5. {
  6. parent::Model();
  7. }
  8. function recommend_m()
  9. {
  10. $this->__construct();
  11. }
  12. function save($data)
  13. {
  14. if(!$data || !is_array($data))
  15. {
  16. return false;
  17. }
  18. return $this->db->insert_array($data,"customer");
  19. }
  20. function get_list($mid)
  21. {
  22. $this->db->close_cache();
  23. $sql = "SELECT * FROM ".$this->db->prefix."list where status='1' ";
  24. if($mid)
  25. {
  26. $sql .= " AND module_id='".$mid."' ";
  27. }
  28. $sql.= " ORDER BY post_date DESC,id DESC ";
  29. return $this->db->get_all($sql);
  30. }
  31. //通过手机号登录验证
  32. function customer_from_cellphone($cellphone)
  33. {
  34. $this->db->close_cache();
  35. $sql = "SELECT id FROM ".$this->db->prefix."customer WHERE cellphone='".$cellphone."'";
  36. $rs = $this->db->get_one($sql);
  37. if(!$rs) return false;
  38. $this->db->open_cache();
  39. return $rs;
  40. }
  41. }
  42. ?>