| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 | 
							- <?php
 
- namespace Cas\Module;
 
- use KIF\Data\Convert;
 
- use KIF\Data\ResultWrapper;
 
- use KIF\Db\Transaction;
 
- use KIF\Cache\Memcached;
 
- use Cas\Dao\LotteryEventsLog;
 
- use Cas\Dao\LotteryUserParticipateLog;
 
- /**
 
-  * 抽奖模型
 
-  * 
 
-  * @author lihuanchun
 
-  *        
 
-  */
 
- class LotteryLog {
 
- 	
 
- 	private $objDLotteryEventsLog;
 
- 	private $objDLotteryUserParticipateLog;
 
- 	private $uid;
 
- 	private $eventsId;
 
- 	
 
- 	
 
- 	/**
 
- 	 * 初始化
 
- 	 */
 
- 	public function __construct($uid=null , $eventsId=null ) {
 
- 		$this->objDLotteryEventsLog = new LotteryEventsLog();// 活动日志
 
- 		$this->objDLotteryUserParticipateLog = new LotteryUserParticipateLog();// 用户"参与"活动日志
 
- 		$this->uid = $uid;
 
- 		$this->eventsId = $eventsId;
 
- 	}
 
- 	
 
- 	
 
- 	/**
 
- 	 * 获取行为类型
 
- 	 */
 
- 	public function getType(){
 
- 		return $this->objDLotteryEventsLog->getType();
 
- 	}
 
- 	
 
- 	/**
 
- 	 *  添加日志
 
- 	 */
 
- 	public function addLog($type,$other){
 
- 		$events_id = $this->eventsId?$this->eventsId:0;
 
- 		$uid = $this->uid?$this->uid:0;
 
- 		$info = array(
 
- 			'events_id' => $events_id,
 
- 			'uid' => $uid,
 
- 			'type' => $type,
 
- 			'other' => $other		
 
- 		);
 
- 		return $this->objDLotteryEventsLog  -> addOne($info);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取虚拟数据【条数】
 
- 	 */
 
- 	public function getLogNum($condition){
 
- 		return  $this->objDLotteryEventsLog->totals($condition);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取一条日志
 
- 	 */
 
- 	public function getOneData($id){
 
- 		return $this->objDLotteryEventsLog->get($id);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取多条日志
 
- 	 */
 
- 	public function getDatas($ids){
 
- 		return $this->objDLotteryEventsLog->gets($ids);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取日志列表IDs
 
- 	 */
 
- 	public function findByIds ($condition , $limit , $order){
 
- 		return  $this->objDLotteryEventsLog->findIdsBy($condition , $limit , $order);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取日志信息
 
- 	 */
 
- 	public function findData($condition , $limit , $order){
 
- 		$ids = $this->findByIds($condition, $limit, $order);
 
- 		return $this->getDatas($ids);
 
- 	}
 
- 	
 
- 	
 
- 	/**
 
- 	 *  添加"用户参与"日志
 
- 	 */
 
- 	public function addUserParticipateLog($other){
 
- 		$events_id = $this->eventsId?$this->eventsId:0;
 
- 		$uid = $this->uid?$this->uid:0;
 
- 		$info = array(
 
- 				'events_id' => $events_id,
 
- 				'uid' => $uid,
 
- 				'other' => $other
 
- 		);
 
- 	
 
- 		return $this->objDLotteryUserParticipateLog->add($info);
 
- 	}
 
- 	
 
- 	
 
- 	/**
 
- 	 * 获取"用户参与"虚拟数据【条数】
 
- 	 */
 
- 	public function getUserParticipateLogNum($condition){
 
- 		return  $this->objDLotteryUserParticipateLog->totals($condition);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取一条"用户参与"日志
 
- 	 */
 
- 	public function getUserParticipateOneData($id){
 
- 		return $this->objDLotteryUserParticipateLog->get($id);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取多条"用户参与"日志
 
- 	 */
 
- 	public function getUserParticipateDatas($ids){
 
- 		return $this->objDLotteryUserParticipateLog->gets($ids);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取"用户参与"日志列表IDs
 
- 	 */
 
- 	public function findByUserParticipateIds ($condition , $limit , $order){
 
- 		
 
- 		return  $this->objDLotteryUserParticipateLog->findIdsBy($condition , $limit , $order);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取"用户参与"日志信息
 
- 	 */
 
- 	public function findUserParticipateData($condition , $limit , $order){
 
- 		$ids = $this->findByUserParticipateIds($condition, $limit, $order);
 
- 		return $this->getUserParticipateDatas($ids);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取 "用户参与" 用户排重日志信息
 
- 	 */
 
- 	public function findUserParticipateDataGroupByUid( $limit , $order){
 
- 		
 
- 		return  $this->objDLotteryUserParticipateLog->findUserParticipateDataGroupByUid($this->eventsId,$limit,$order);
 
- 	}
 
- 	
 
- 	/**
 
- 	 * 获取"用户参与"用户排重虚拟数据【条数】
 
- 	 */
 
- 	public function getUserParticipateLogNumGroupByUid(){
 
- 		return  $this->objDLotteryUserParticipateLog->getUserParticipateLogNumGroupByUid($this->eventsId);
 
- 	}
 
- 	
 
- 	
 
- 	
 
- }
 
 
  |