12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Core\Request;
- use KIF\Cache\Memcached;
- /**
- *
- * 活动 投放渠道
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryDeliveryChannels extends DBAgileDev {
- protected $tableName = 'lottery_delivery_channels';
-
- /**
- * 数据库里的真实字段
- * @var array
- */
- protected $other_field = array(
- 'str_name',
- 'events_id',
- 'platform_id',
- 'pv_num'
- );
-
- /**
- * 添加一个PV
- */
- public function addOnePV($id){
- $data = $this->get($id);
- $info = array(
- 'pv_num' => $data['pv_num'] + 1
- );
- return $this->modify($info,array('id' => $id));
- }
-
- /**
- * 添加默认渠道用cache 计数
- */
- public function addDefaultEventOnePV($schemeDomain,$events_id,$platform_id){
- $key = $schemeDomain.'_'.$events_id.'_'.$platform_id;
- $objMemcached = new Memcached();
- $num = $objMemcached->get($key);
- if($num){
- $objMemcached->set($key,$num+1);
- }else{
- $objMemcached->set($key,1);
- }
- }
-
- /**
- * 获取默认渠道用cache 计数
- */
- public function getDefaultEventOnePV($schemeDomain,$events_id,$platform_id){
- $key = $schemeDomain.'_'.$events_id.'_'.$platform_id;
- $objMemcached = new Memcached();
- return $objMemcached->get($key);
- }
-
- }
|