reward.php 961 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. defined('IN_WEB') or die( 'Include Error!');
  3. /**
  4. * 分享奖励统计
  5. */
  6. class ModelReward {
  7. /**
  8. * 每日分享次数统计
  9. * @param $shareType #分享类型 $type #selfType分享 otherType点击分享
  10. * @return int
  11. * Created by: hss
  12. */
  13. public function todayShareStatistics($shareType,$config,$type = 'selfType'){
  14. if (empty($shareType) || empty($config)) {
  15. return -1;
  16. }
  17. $type = ($type != 'selfType')?'otherType':'selfType';
  18. if($config[$type] == 1){
  19. $rewardType = "money";
  20. }else if($config[$type] == 2){
  21. $rewardType = 'spins';
  22. }
  23. oo::commonOprRedis('Statistics')->hIncrBy(okeys::todayShareStatistics($shareType,$type),$rewardType,($type != 'selfType')?$config['otherReward']:$config['selfReward']);
  24. oo::commonOprRedis('Statistics')->hIncrBy(okeys::todayShareStatistics($shareType,$type),'successNumber',1);
  25. }
  26. }