12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- class personal_m extends Model
- {
- function __construct()
- {
- parent::Model();
- }
- function personal_m()
- {
- $this->__construct();
- }
- function get_list($uid,$offset=0,$psize=30)
- {
- $sql = "SELECT * FROM ".$this->db->prefix."commission WHERE uid='".$uid."' ORDER BY postdate DESC,id DESC LIMIT ".$offset.",".$psize;
- return $this->db->get_all($sql);
- }
- //获取所有已推荐客户
- function get_count_all($uid)
- {
- $sql = "SELECT count(id) from ".$this->db->prefix."customer where uid=".$uid;
- return $this->db->count($sql);
- }
- //获取所有已成交的推荐客户
- function get_count_ok($uid)
- {
- $sql = "SELECT count(id) from ".$this->db->prefix."customer where huikuan=1 and uid=".$uid;
- return $this->db->count($sql);
- }
- function get_count_cur($uid,$status=0)
- {
- $sql = "SELECT sum(money) total FROM ".$this->db->prefix."commission WHERE uid='".$uid."' and status='".$status."' ";
- return $this->db->count($sql);
- }
- }
- ?>
|