123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- class Credit3logDao {
-
- public $id;
-
- public $uid;
-
- public $action;
-
- public $amount;
-
- public $time;
-
- public $username;
-
- public $ip;
-
- public $qid;
-
- public $_table = t_credit3log;
-
- public $_primarykey = "id";
-
- public $_fields = array ('id', 'uid', 'qid', 'action', 'amount', 'time', 'username', 'ip' );
-
- /**
- * 设置回答被采纳的ACTION说明
- */
- public function set_ACTION_ADOPT_QUESTION() {
- return $this->username . "用户在" . format_date ( $this->time ) . "时间" . $this->ip . "IP回答被采纳,获得财富为" . $this->amount . ";问题ID为" . $this->qid;
- }
-
- /**
- * 设置发布悬赏问题的action说明
- */
- public function set_ACTION_OFFER_QUESTION() {
- return $this->username . "用户在" . format_date ( $this->time ) . "时间" . $this->ip . "IP发起了悬赏为" . $this->amount . "的问题" . $this->qid . "ID";
- }
-
- /**
- * 设置退款问题的action说明
- */
- public function set_ACTION_REFUNDS_QUESTION() {
- return $this->username . "用户在" . format_date ( $this->time ) . "时间" . $this->ip . "IP名师答疑回答不满意,退款" . $this->amount . ";问题ID为" . $this->qid;
- }
-
- /**
- * 发布名师答疑问题的action说明
- */
- public function set_ACTION_ADD_VIP_QUESTION() {
- return $this->username . "用户在" . format_date ( $this->time ) . "时间" . $this->ip . "IP发起了名师答疑,悬赏为" . $this->amount . ";问题ID为" . $this->qid;
- }
-
- /**
- * 添加一条财富流向记录
- * @param unknown_type $uid
- * @param unknown_type $username
- * @param unknown_type $action
- * @param unknown_type $amount
- * @param unknown_type $ip
- */
- public function add_credit3_log($uid = 0, $username = "", $qid = 0, $action = "", $amount = 0, $ip = "",$is_vip=0) {
-
- $sql = "INSERT INTO " . t_credit3log . "(uid,username,qid,action,amount,time,ip,is_vip) VALUES (" . $uid . ",'" . $username . "'," . $qid . ",'" . $action . "','" . $amount . "'," . get_date () . ",'" . $ip . "','".$is_vip."')";
-
- $query = Doo::db ()->query ( $sql );
- }
-
- /**
- * 获取用户财富流向明细
- * @param unknown_type $uid
- */
- function get_list_by_uid($uid = 0) {
-
- $sql = "select * from " . t_credit3log . " where uid = " . $uid;
-
- $query = Doo::db ()->query ( $sql );
-
- $result = $query->fetchAll ();
-
- return $result;
- }
- function get_all_list(){
- $sql = "select * from " . t_credit3log;
- $query = Doo::db ()->query ( $sql );
- $result = $query->fetchAll ();
- return $result;
- }
- }
- ?>
|