Exemplo n.º 1
0
 function getRewardByTids($tids)
 {
     if (!S::isArray($tids)) {
         return false;
     }
     $query = $this->_db->query(pwQuery::selectClause($this->_tableName, "{$this->_primaryKey} IN (:{$this->_primaryKey})", array($tids)));
     return $this->_getAllResultFromQuery($query, 'tid');
 }
Exemplo n.º 2
0
 /**
  * 统计所有套餐数量
  * @return int
  */
 function countSpreads()
 {
     $total = $this->_db->get_value(pwQuery::selectClause($this->_tableName, '', array(), array(PW_EXPR => array('COUNT(*) AS total'))));
     return $total;
 }
Exemplo n.º 3
0
 /**
  * 根据fid批量统计已被购买的孔明灯数量
  * @param array $fids
  * @return array
  */
 function countUsedKmdNumsByFids($fids)
 {
     if (!S::isArray($fids)) {
         return false;
     }
     $query = $this->_db->query(pwQuery::selectClause($this->_tableName, 'fid IN(:fid) AND uid!=:uid', array($fids, 0), array(PW_COLUMN => array('fid'), PW_EXPR => array('COUNT(fid) AS total'), PW_GROUPBY => array('fid'))));
     return $this->_getAllResultFromQuery($query, 'fid');
 }
Exemplo n.º 4
0
 /**
  * 根据uid统计记录数量
  * @param int $uid
  * @return int
  */
 function countPayLogsByUid($uid)
 {
     $uid = intval($uid);
     if ($uid < 1) {
         return false;
     }
     $total = $this->_db->get_value(pwQuery::selectClause($this->_tableName, '', array(), array(PW_EXPR => array('COUNT(*) AS total'))));
     return $total;
 }
Exemplo n.º 5
0
 function countRecordsByTidAndUid($tid, $uid)
 {
     list($tid, $uid) = array(intval($tid), intval($uid));
     if ($tid < 1 || $uid < 1) {
         return false;
     }
     $query = $this->_db->query(pwQuery::selectClause($this->_tableName, "tid=:tid AND uid=:uid", array($tid, $uid), array(PW_EXPR => array('COUNT(*) AS total'))));
     $result = $this->_db->fetch_array($query);
     return $result['total'];
 }