tablePrefix ='tab_'; /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } //获取列表 public function get_lists($where){ return $this->where($where)->select(); } //获取折扣 public function get_discount($game_id){ $map['game_id'] = $game_id; $map['promote_id'] = PID; $data = $this->where($map)->find(); if (empty($data)){ $game = M('game','tab_')->find($game_id); return $game['discount']; }else{ $discount = discount_data($data); return $discount['promote_discount']; } } }