浏览代码

fixing: 行为分析

王刚 3 年之前
父节点
当前提交
055ba8e7b6

+ 1 - 2
Gameserver/Public/gamesys/app/models/Resp.php

@@ -1,9 +1,8 @@
 <?php
 
 /**
- * Description of Resp
  * 应答体
- * @author jgao
+ * @author gwang
  */
 class Resp {
     //put your code here

+ 6 - 9
Gameserver/Public/gamesys/app/providers/GameContinuedTs.php

@@ -12,7 +12,7 @@ $zoneid = $params['date']['zoneid'];
 $sqlName = "tab_op_log" . $date;
 
 $arr = daoInst()->select("*")->from($sqlName)
-        ->where('cmd')->eq(6901)
+        ->where('cmd')->eq(6903)
         ->andWhere('zoneid')->eq($zoneid)
         ->andWhere('uid')->eq($uid)
         ->fetchAll();
@@ -40,7 +40,7 @@ foreach ($arr as $item) {
     }
     $num+=1;
     $lastItem = $item;
-    if(count($arr)==$num){
+    if (count($arr)==$num) {
         $list[] = $item;
         
         $timeDic = new stdClass();
@@ -48,13 +48,10 @@ foreach ($arr as $item) {
         $timeDic->endTs = strtotime($list[count($list) - 1]->ts);
         $timeDic->durationTs = strtotime($list[count($list) - 1]->ts) - strtotime($list[0]->ts);
 
-        $dic->$index = $timeDic;     
+        $dic->$index = $timeDic;
         break;
     }
 }
-
-$result = new stdClass();
-$result->data = $dic;
-
-echo Resp::ret($result);
-//echo json_encode($result); 
+  
+echo Resp::ret($dic);
+//echo json_encode($result);

+ 4 - 8
Gameserver/Public/gamesys/home/pages/GameContinuedTs/GameContinuedTs.js

@@ -23,10 +23,7 @@ function sendMail() {
     var zoneid = 1;
     var uid = $("#i-uid").val(); // "D51D63CA040982E406BDE9898AD757AE";
     var ts = moment($("#i-date").val()).format('YYYYMMDD') ; //"20201119";
-
-    //    var titleTxt = $("#title-text").val();
-    //    var fromTxt = $("#from-text").val();
-
+  
     var data = {
         zoneid: zoneid,
         uid: uid,
@@ -42,12 +39,11 @@ function sendMail() {
             
             $("canvas#myChart").remove();
             $("div.chart_wrap").append('<canvas id="myChart" class="animated fadeIn" ></canvas>');
-            ctx = $("#myChart");
-            ddd = ret.data;
+            ctx = $("#myChart"); 
             lbls = [];
             ds = [];
-            for (var i in ddd) {
-                info = ddd[i];
+            for (var i in ret) {
+                info = ret[i];
                 l = ts2time(info.startTs) + "-" + ts2time(info.endTs);
                 lbls.push(l);
                 ds.push(Math.floor(info.durationTs/60) );

+ 4 - 0
Gameserver/Public/gamesys/home/pages/action/action.js

@@ -88,6 +88,10 @@ function ok_click() {
         return;
     }
 
+    if(date1 - date >21){
+        alert("时间间隔不要超过21天");
+        return;
+    }
 
     var url = getProviderUrl("action");
     url += "?date=" + date;

+ 58 - 59
Gameserver/Public/gamesys/home/pages/api.js

@@ -1,63 +1,62 @@
- 
-function getRootPath() { 
-    var curWwwPath = window.document.location.href; 
-    var pathName = window.document.location.pathname;  
-//    console.log(pathName);
-    var pos = curWwwPath.indexOf(pathName); 
-    var localhostPath = curWwwPath.substring(0, pos);  
-    // 这种写法,限制项目名称必须包含gamesys,wg
-    var projectName = pathName.substring(0, pathName.substr(0).lastIndexOf('gamesys/'))+'gamesys/';
-//    console.log(projectName);
-     projectName = projectName.substring(0, projectName.substr(0).lastIndexOf('/') + 1); 
-    return localhostPath+projectName;
-}
+function getRootPath() {
+     var curWwwPath = window.document.location.href;
+     var pathName = window.document.location.pathname;
+     //    console.log(pathName);
+     var pos = curWwwPath.indexOf(pathName);
+     var localhostPath = curWwwPath.substring(0, pos);
+     // 这种写法,限制项目名称必须包含gamesys,wg
+     var projectName = pathName.substring(0, pathName.substr(0).lastIndexOf('gamesys/')) + 'gamesys/';
+     //    console.log(projectName);
+     projectName = projectName.substring(0, projectName.substr(0).lastIndexOf('/') + 1);
+     return localhostPath + projectName;
+ }
 
-function getProviderUrl(tag){
-	return getRootPath() + "app/providers/" + tag + ".php";
-}
+ function getProviderUrl(tag) {
+     return getRootPath() + "app/providers/" + tag + ".php";
+ }
 
-/**
- * 获取cookies
- * @param {Object} name
- */
-function getCookie(key){  
-    var arr = document.cookie.match(new RegExp("(^| )"+key+"=([^;]*)(;|$)"));  
-    if(arr != null){  
-     	return unescape(arr[2]);   
-    }else{  
-     	return null;  
-    }
-}
+ /**
+  * 获取cookies
+  * @param {Object} name
+  */
+ function getCookie(key) {
+     var arr = document.cookie.match(new RegExp("(^| )" + key + "=([^;]*)(;|$)"));
+     if (arr != null) {
+         return unescape(arr[2]);
+     } else {
+         return null;
+     }
+ }
 
-/**
- * 向服务端post数据
- * @param {Object} url
- * @param {Object} body
- * @param {Object} suc
- */
-function post(url, body, suc){
-	body.account = getCookie("account");
-	$.ajax({
-		type:"post",
-		url:url,
-		async:true,
-		data:body,
-		success:function(token){
-        	// 解析回传的数据
-        	//alert(token);
-        	token = JSON.parse(token);
-        	if(token.err==0){
-        		suc(token.data);
-        	}else{
-        		onError(token);
-        	}
-      	}
-	});
-}
+ /**
+  * 向服务端post数据
+  * @param {Object} url
+  * @param {Object} body
+  * @param {Object} suc
+  */
+ function post(url, body, suc) {
+     body.account = getCookie("account");
+     $.ajax({
+         type: "post",
+         url: url,
+         async: true,
+         data: body,
+         success: function(token) {
+             // 解析回传的数据
+             //alert(token);
+             token = JSON.parse(token);
+             if (token.err == 0) {
+                 suc(token.data);
+             } else {
+                 onError(token);
+             }
+         }
+     });
+ }
 
-function onError(token){
-	if(token.err == 6001){
-		alert(token.errMsg);
-		location.href = "login.html";
-	}
-}
+ function onError(token) {
+     if (token.err == 6001) {
+         alert(token.errMsg);
+         location.href = "login.html";
+     }
+ }