12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Core\Request;
- /**
- *
- * 活动LOG表
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryEventsLog extends DBAgileDev {
- protected $tableName = 'lottery_events_log';
-
- /**
- * 数据库里的真实字段
- * @var array
- */
- protected $other_field = array(
- 'events_id',
- 'type',
- 'uid',
- );
-
- /**
- * LOG_TYPE_PASS 访问
- * @var int
- */
- const LOG_TYPE_PASS = 1;
- /**
- * LOG_TYPE_PARTICIPATION 参与
- * @var int
- */
- const LOG_TYPE_PARTICIPATION = 2;
- /**
- * LOG_TYPE_RECEIVE 获得
- * @var int
- */
- const LOG_TYPE_RECEIVE = 3;
- /**
- * LOG_TYPE_PARTICIPATION_TRUE 参与成功
- * @var int
- */
- const LOG_TYPE_PARTICIPATION_TRUE = 4;
-
-
- public static $type= array(
- self::LOG_TYPE_PASS => array(
- 'desc' => '访问',
- 'kw' => 'LOG_TYPE_PASS',
- ),
- self::LOG_TYPE_PARTICIPATION => array(
- 'desc' => '参与',
- 'kw' => 'LOG_TYPE_PARTICIPATION',
- ),
- self::LOG_TYPE_RECEIVE => array(
- 'desc' => '获得',
- 'kw' => 'LOG_TYPE_RECEIVE',
- ),
- self::LOG_TYPE_PARTICIPATION_TRUE => array(
- 'desc' => '参与成功',
- 'kw' => 'LOG_TYPE_PARTICIPATION_TRUE',
- ),
- );
-
- /**
- * 获取TYPE 行为
- * @return array
- */
- public static function getType() {
- return self::$type;
- }
-
-
- /**
- * 添加记录
- */
- public function addOne($info){
-
- $info['ip'] = Request::ip();
- $info['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
-
- return $this->add($info);
- }
-
-
-
- }
|