• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php 接续留存与留存人数计算

php 搞代码 3年前 (2022-01-24) 11次浏览 已收录 0个评论

php 连续留存与留存人数计算

for($i = 0;$i turnround($today,$tomorrow,$flag); 		        $temp = array(); 		        foreach($res as $value){		        	$inmatch = isset($value['inmatch']) ? json_decode($value['inmatch']) : array();		            foreach($inmatch as $val) {		            	if(!in_array($val, $temp)) {	                        array_unshift($temp,$val);  		            	}		            }		        }		        $i==0 ? $total = count($temp) : "";     		        $temp = array_fill_keys($temp, $i); 		        foreach($temp as $k=>$v) {		        	if(array_key_exists($k,$stats)) { 	                    $stats[$k] = $stats[$k].",".$v;		        	} else {		        		$stats[$k] = $v;		        	}		        }		        $today    = $today + 86400; 	            $tomorrow = $tomorrow + 86400;        		    }			$strlen = ($interval+1)*2-1;			foreach($stats as $v) {				if(isset($v)) {					strlen(trim($v)) == $strlen ? $num++ : $num;				}					}			$ret['turnround']['all']   = $stats;			$ret['turnround']['total'] = $total;			$ret['turnround']['stats'] = count($stats);			$ret['turnround']['num']   = $num; 			*/			$res = $model->turnround($today,$tomorrow,$flag);             $todayPeople = array(); 	        foreach($res as $value){	        	$inmatch = isset($value['inmatch']) ? json_decode($value['inmatch']) : array();	            foreach($inmatch as $va<a>@本文9来源gao($daima.com搞@代@#码8网^</a><strong>搞代gaodaima码</strong>l) {	            	if(!in_array($val, $todayPeople)) {                        array_unshift($todayPeople,$val);  	            	}	            }	        }	        $todayNum   = count($todayPeople);  	        $atToday    = $today + $interval*86400;	        $atTomorrow = $tomorrow + $interval*86400; 	        $atRes = $model->turnround($atToday,$atTomorrow,$flag); 	        $atPeople = array(); 	        foreach($atRes as $v){	        	$atInmatch = isset($v['inmatch']) ? json_decode($v['inmatch']) : array();	            foreach($atInmatch as $val) {	            	if(!in_array($val, $atPeople)) {                        array_unshift($atPeople,$val);  	            	}	            }	        }	        $same = array_intersect($todayPeople,$atPeople);	        $atNum= count($same);	        $ret['turnround']['all']   = $todayPeople;   			$ret['turnround']['total'] = $todayNum;      			$ret['turnround']['stats'] = "";    			$ret['turnround']['num']   = $atNum;      


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php 接续留存与留存人数计算
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址