Merge branch 'dev_zcl' into dev

# Conflicts:
#	Data/update.sql
master
zhengchanglong 5 years ago
commit 36c4e476ea

@ -1331,26 +1331,28 @@ class StatController extends ThinkController
* @author 鹿文学
*/
public function device_survey() {
$device = D('DeviceRecord');
set_time_limit(0);
// $device = D('DeviceRecord');
// 统计
$total = $device->all_device();
$todaystart = mktime(0,0,0,date('m'),date('d'),date('Y'));
$today = $device->total_device(['create_time'=>array('between',[$todaystart,$todaystart+86399])]);
$yesterday = $device->total_device(['create_time'=>array('between',[$todaystart-86400,$todaystart-1])]);
$day7 = $device->total_device(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])],1);
$day30 = $device->total_device(['create_time'=>array('between',[$todaystart-86400*30,$todaystart-1])],1);
$duration = $device->single_duration(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])]);
$this->assign('total',$total);
$this->assign('today',$today);
$this->assign('yesterday',$yesterday);
$this->assign('day7',$day7);
$this->assign('day30',$day30);
$this->assign('duration7',second_to_duration($duration/7));
// $total = $device->all_device();
// $todaystart = mktime(0,0,0,date('m'),date('d'),date('Y'));
// $today = $device->total_device(['create_time'=>array('between',[$todaystart,$todaystart+86399])]);
// $yesterday = $device->total_device(['create_time'=>array('between',[$todaystart-86400,$todaystart-1])]);
//
// $day7 = $device->total_device(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])],1);
//
//
// $day30 = $device->total_device(['create_time'=>array('between',[$todaystart-86400*30,$todaystart-1])],1);
// $duration = $device->single_duration(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])]);
// $this->assign('total',$total);
// $this->assign('today',$today);
// $this->assign('yesterday',$yesterday);
// $this->assign('day7',$day7);
// $this->assign('day30',$day30);
// $this->assign('duration7',second_to_duration($duration/7));
// 日历
R('Index/calendar');
@ -1362,6 +1364,39 @@ class StatController extends ThinkController
}
public function getDevice() {
set_time_limit(0);
$type = I("type",0);
$device = D('DeviceRecord');
$todaystart = mktime(0,0,0,date('m'),date('d'),date('Y'));
$model = M('device_statistics','tab_');
if ($type == 0) {
$return = $model->sum('new_device');
// $return = $device->all_device();
} else if($type == 1) {
$return = $model->where(['time'=>array('between',[$todaystart,$todaystart+86399])])->sum('new_device');
// $return = $device->total_device(['create_time'=>array('between',[$todaystart,$todaystart+86399])]);
} else if($type == 2) {
$return = $model->where(['time'=>array('between',[$todaystart-86400,$todaystart-1])])->sum('new_device');
// $return = $device->total_device(['create_time'=>array('between',[$todaystart-86400,$todaystart-1])]);
} else if($type == 3) {
$return = $model->where(['time'=>array('between',[$todaystart-86400*7,$todaystart-1])])->sum('active_device');
// $return = $device->total_device(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])],1);
} else if($type == 4) {
$return = $model->where(['time'=>array('between',[$todaystart-86400*30,$todaystart-1])])->sum('active_device');
// $return = $device->total_device(['create_time'=>array('between',[$todaystart-86400*30,$todaystart-1])],1);
} else if ($type == 5) {
$return = second_to_duration(($model->where(['time'=>$todaystart])->sum('duration7')));
// $return = second_to_duration($device->single_duration(['create_time'=>array('between',[$todaystart-86400*7,$todaystart-1])])/7);
}
$this->ajaxReturn($return?$return:0) ;
}
/*
* 折线图
@ -1399,14 +1434,19 @@ class StatController extends ThinkController
$data['active']['and'][$v] = 0;
}
$deviceDataAnd = M("device_statistics","tab_")->where(['time'=>strtotime($start),'version'=>1])->find();
$deviceDataIos = M("device_statistics","tab_")->where(['time'=>strtotime($start),'version'=>2])->find();
// 新增设备
$hoursnews = $device->news_on_time(['create_time'=>['between',[$starttime,$endtime]]],'news',5,'time,version');
// $hoursnews = $device->news_on_time(['create_time'=>['between',[$starttime,$endtime]]],'news',5,'time,version');
$hoursnews = array_merge(json_decode($deviceDataAnd['today_new_device'],true),json_decode($deviceDataIos['today_new_device'],true));
// 活跃设备
$hoursactive = $device->active_on_time(['create_time'=>['between',[$starttime,$endtime]]],'active',5,'time,version');
// $hoursactive = $device->active_on_time(['create_time'=>['between',[$starttime,$endtime]]],'active',5,'time,version');
$hoursactive = array_merge(json_decode($deviceDataAnd['today_active_device'],true),json_decode($deviceDataIos['today_active_device'],true));
// 启动机型
$hoursmodel = $device->model(['create_time'=>['between',[$starttime,$endtime]]]);
// $hoursmodel = $device->model(['create_time'=>['between',[$starttime,$endtime]]]);
$hoursmodel = array_merge(json_decode($deviceDataAnd['today_model_device'],true),json_decode($deviceDataIos['today_model_device'],true));
foreach($hours as $v) {
foreach($hoursnews as $h) {
@ -1445,15 +1485,68 @@ class StatController extends ThinkController
$data['active']['ios'][$v] = 0;
$data['active']['and'][$v] = 0;
}
$newData = M('device_statistics','tab_')
->field("new_device as news,version,FROM_UNIXTIME(time,'%Y-%m-%d') as time")
->where(['time'=>['between',[$starttime,$endtime]],'new_device'=>['neq','0']])
->group('time,version')
->select();
// 新增设备
$news = $device->news_on_time(['create_time'=>['between',[$starttime,$endtime]]],'news',$num==7?2:1,'time,version');
// $news = $device->news_on_time(['create_time'=>['between',[$starttime,$endtime]]],'news',$num==7?2:1,'time,version');
$news = $newData;
$activeData = M('device_statistics','tab_')
->field("active_device as active,version,FROM_UNIXTIME(time,'%Y-%m-%d') as time")
->where(['time'=>['between',[$starttime,$endtime]],'active_device'=>['neq','0']])
->group('time,version')
->select();
// 活跃设备
$active = $device->active_on_time(['create_time'=>['between',[$starttime,$endtime]]],'active',$num==7?2:1,'time,version');
// $active = $device->active_on_time(['create_time'=>['between',[$starttime,$endtime]]],'active',$num==7?2:1,'time,version');
$active = $activeData;
// 启动机型
$model = $device->model(['create_time'=>['between',[$starttime,$endtime]]]);
$modelData = M('device_statistics','tab_')
->field("model")
->where(['time'=>['between',[$starttime,$endtime]]])
->select();
$modelNew = [];
$unique_code = [];
foreach($modelData as $key => $value) {
$resolveData = json_decode($value['model'],true);
// dump($resolveData);
foreach($resolveData as $k => $v) {
if (!isset($modelNew[$v['model']][$v['version']])) {
$modelNew[$v['model']][$v['version']] = 1;
$unique_code[$v['unique_code']] = 1;
} else if(!$unique_code[$v['unique_code']]){
$modelNew[$v['model']][$v['version']]++;
$unique_code[$v['unique_code']] = 1;
// array_push($unique_code,$v['unique_code']);
}
}
}
$unique_code = [];
$modelNewData = [];
$modelKey = 0;
foreach($modelNew as $key => $value) {
$modelNewData[$modelKey]['model'] = $key;
foreach($value as $k => $v) {
$modelNewData[$modelKey]['version'] = $k;
$modelNewData[$modelKey]['count'] = $v;
}
$modelKey++;
}
$last_names = array_column($modelNewData,'count');
array_multisort($last_names,SORT_DESC,$modelNewData);
// dump($modelNewData);
// die();
// $model = $device->model(['create_time'=>['between',[$starttime,$endtime]]]);
// dump($model);die();
$model = $modelNewData;
foreach($datelist as $v) {
foreach($news as $h) {

@ -0,0 +1,194 @@
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class TimingController extends AdminController {
public function _initialize(){
}
public function caculateDeviceInfo() {
$start = 1569686400;
$end = time();
if (I('time')) {
$start = strtotime(I('time'));
$end = $start+1;
}
if (I('start')) {
$start = strtotime(I('start'));
}
ini_set('memory_limit','1024M');
// $device = D('DeviceRecord');
// echo 1;
for($startTime = $start;$startTime<$end;$startTime=$startTime+86400) {
echo date("Y-m-d",$startTime).' 安卓 ';
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>1])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
echo $data['new_device'].' ';
//当日活跃设备
$data['active_device'] = $this->active(['create_time'=>array('between',[$startTime,$startTime+86399]),'version'=>1]);
echo $data['active_device'].' ';
$data['time'] = $startTime;
$data['version'] = 1;
$data['today_new_device'] =json_encode($this->news_on_time(['create_time'=>['between',[$startTime,$startTime+86399]]],'news',5,'time,version','time',1));
// echo M('device_record','tab_')->_sql()."\n";
$data['today_active_device'] =json_encode($this->active_on_time(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>1],'active',5,'time,version'));
// echo M('device_record','tab_')->_sql()."\n";
$data['today_model_device'] = json_encode($this->model(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>1]));
$data['model'] = json_encode($this->modelDevice(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>1]));
$duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])]);
$newSqls = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->group('unique_code')->select(false);
$data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSqls . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->find();
echo "\n";
if (!$getStatistics) {
M('device_statistics','tab_')->add($data);
} else {
M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->save($data);
}
echo date("Y-m-d",$startTime).' 苹果 ';
//当日新增设备
$newSql = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->where(['version'=>2])->group('unique_code')->select(false);
$data['new_device'] = M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime,$startTime+86399])])->order('create_time')->count();
echo $data['new_device'].' ';
//当日活跃设备
$data['active_device'] = $this->active(['create_time'=>array('between',[$startTime,$startTime+86399]),'version'=>2]);
echo $data['active_device'].' ';
$data['time'] = $startTime;
$data['version'] = 2;
echo 0;
$data['today_new_device'] =json_encode($this->news_on_time(['create_time'=>['between',[$startTime,$startTime+86399]]],'news',5,'time,version','time',2));
// echo M('device_record','tab_')->_sql();die();
echo 1;
$data['today_active_device'] =json_encode($this->active_on_time(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>2],'active',5,'time,version'));
echo 2;
$data['today_model_device'] = json_encode($this->model(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>2]));
echo 3;
$data['model'] = json_encode($this->modelDevice(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>2]));
// $duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1]),'version'=>2]);
// $data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
$data['duration7'] = 0;
echo 4;
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>2])->find();
echo "\n";
if (!$getStatistics) {
M('device_statistics','tab_')->add($data);
} else {
M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>2])->save($data);
}
}
}
public function duration($map=array()) {
return M('device_record','tab_')->where($map)->sum('duration');
}
public function active($map=array()) {
$sql = M('device_record','tab_')->field('create_time,model,unique_code')->where($map)->select(false);
$sql = M('device_record','tab_')->table('(' . $sql . ') as a')->group('unique_code')->order('create_time')->select(false);
$sql = "select count(*) as count from ({$sql})t";
$count = M('device_record','tab_')->query($sql);
return $count[0]['count'];
}
public function news_on_time($map=array(),$field='news',$flag=1,$group='time',$order='time',$version = 1) {
switch($flag) {
case 2:{$dateform = '%Y-%m';};break;
case 3:{$dateform = '%Y-%u';};break;
case 4:{$dateform = '%Y';};break;
case 5:{$dateform = '%Y-%m-%d %H';};break;
default:$dateform = '%Y-%m-%d';
}
$sql = M('device_record','tab_')->field('min(create_time) as create_time,version,unique_code,id')->where(['version'=>$version])->group('unique_code')->select(false);
$news = M('device_record','tab_')->table('(' . $sql . ') as a')
->field('FROM_UNIXTIME(a.create_time, "'.$dateform.'") as '.$group.',group_concat(a.id) as id,group_concat(a.unique_code) as unique_code ,COUNT(a.unique_code) AS '.$field)
->where($map)->group($group)->order($order)->select();
// echo M('device_record','tab_')->_sql();die();
return $news;
}
public function active_on_time($map=array(),$field='active',$flag=1,$group='time',$order='time') {
switch($flag) {
case 2:{$dateform = '%Y-%m';};break;
case 3:{$dateform = '%Y-%u';};break;
case 4:{$dateform = '%Y';};break;
case 5:{$dateform = '%Y-%m-%d %H';};break;
default:$dateform = '%Y-%m-%d';
}
$sql = M('device_record','tab_')->field('create_time,version,unique_code,id')->where($map)->select(false);
$mid = M('device_record','tab_')->table('(' . $sql . ') as m')->group('unique_code')->select(false);
$active = M('device_record','tab_')->table('(' . $mid . ') as a')
->field('FROM_UNIXTIME(a.create_time, "'.$dateform.'") as '.$group.',group_concat(a.id) as id,group_concat(a.unique_code) as unique_code ,COUNT(a.unique_code) AS '.$field)
->group($group)->order($order)->select();
// echo $this->_sql();die();
return $active;
}
public function model($map=array()) {
$sql = M('device_record','tab_')->field('create_time,model,version,unique_code')->where($map)->select(false);
$mid = M('device_record','tab_')->table('(' .$sql. ') as m')->group('unique_code')->select(false);
return M('device_record','tab_')->table('(' .$mid. ') as a')->field('a.model,version,count(a.unique_code) as count')->group('model,version')->order('count desc')->select();
}
public function modelDevice($map=array()) {
$sql = M('device_record','tab_')->field('model,version,unique_code')->where($map)->select(false);
$mid = M('device_record','tab_')->table('(' .$sql. ') as m')->group('unique_code')->select();
return $mid;
}
}

@ -46,10 +46,13 @@ class DeviceRecordModel extends Model{
* @author 鹿文学
*/
public function all_device() {
$list = $this->field('min(create_time) as create_time,unique_code')->group('unique_code')->select();
return count($list);
// $list = $this->field('unique_code')->group('unique_code')->count();
$sql = "SELECT count(1) as count from (select unique_code from tab_device_record group by unique_code)t;";
$list = $this->query($sql);
return $list[0]['count'];
}
@ -60,7 +63,7 @@ class DeviceRecordModel extends Model{
public function total_device($map=array(),$flag=0) {
if($flag) {
$list = $this->active($map);
$list = $this->active($map);
} else {
$list = $this->news($map);
}
@ -76,7 +79,7 @@ class DeviceRecordModel extends Model{
public function news($map=array()) {
$sql = $this->field('min(create_time) as create_time,model,unique_code,id')->group('unique_code')->select(false);
return $this->table('(' . $sql . ') as a')->where($map)->order('create_time')->select();
}
@ -89,7 +92,7 @@ class DeviceRecordModel extends Model{
* @author 鹿文学
*/
public function news_on_time($map=array(),$field='news',$flag=1,$group='time',$order='time') {
switch($flag) {
case 2:{$dateform = '%Y-%m';};break;
case 3:{$dateform = '%Y-%u';};break;
@ -97,13 +100,13 @@ class DeviceRecordModel extends Model{
case 5:{$dateform = '%Y-%m-%d %H';};break;
default:$dateform = '%Y-%m-%d';
}
$sql = $this->field('min(create_time) as create_time,version,unique_code,id')->group('unique_code')->select(false);
$news = $this->table('(' . $sql . ') as a')
->field('FROM_UNIXTIME(a.create_time, "'.$dateform.'") as '.$group.',group_concat(a.id) as id,group_concat(a.unique_code) as unique_code ,COUNT(a.unique_code) AS '.$field)
->where($map)->group($group)->order($order)->select();
return $news;
}
@ -145,7 +148,7 @@ class DeviceRecordModel extends Model{
$active = $this->table('(' . $mid . ') as a')
->field('FROM_UNIXTIME(a.create_time, "'.$dateform.'") as '.$group.',group_concat(a.id) as id,group_concat(a.unique_code) as unique_code ,COUNT(a.unique_code) AS '.$field)
->group($group)->order($order)->select();
// echo $this->_sql();die();
return $active;
}
@ -160,6 +163,7 @@ class DeviceRecordModel extends Model{
$mid = $this->table('(' .$sql. ') as m')->group('unique_code')->select(false);
// echo $this->_sql();die();
return $this->table('(' .$mid. ') as a')->field('a.model,version,count(a.unique_code) as count')->group('model,version')->order('count desc')->select();

@ -81,33 +81,33 @@
<div class="main_content_main m-channel-data main_content_platform" style="border-bottom:1px solid #ddd;margin-bottom:15px;padding:17px 0;">
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$today|default=0}</strong> <span class="s-c-title">今日新增设备</span>
<div class="col-md-2" onclick="gettotal(1,'#today');">
<strong class="s-c-orange" id = "today">加载中...</strong> <span class="s-c-title">今日新增设备</span>
</div>
</div>
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$yesterday|default=0}</strong> <span class="s-c-title">昨日新增设备</span>
<div class="col-md-2" onclick="gettotal(2,'#yesterday')">
<strong class="s-c-orange" id = "yesterday">加载中...</strong> <span class="s-c-title">昨日新增设备</span>
</div>
</div>
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$total|default=0}</strong> <span class="s-c-title">累计设备</span>
<div class="col-md-2" onclick="gettotal(0,'#total')">
<strong class="s-c-orange" id = "total">加载中...</strong> <span class="s-c-title">累计设备</span>
</div>
</div>
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$day7|default=0}</strong> <span class="s-c-title">近7日活跃设备</span>
<div class="col-md-2" onclick="gettotal(3,'#day7')">
<strong class="s-c-orange" id = "day7">加载中...</strong> <span class="s-c-title">近7日活跃设备</span>
</div>
</div>
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$day30|default=0}</strong> <span class="s-c-title">近30日活跃设备</span>
<div class="col-md-2" onclick="gettotal(4,'#day30')">
<strong class="s-c-orange"id = "day30">加载中...</strong> <span class="s-c-title">近30日活跃设备</span>
</div>
</div>
<div class="main_content_main_item">
<div class="col-md-2">
<strong class="s-c-orange">{$duration7|default='00:00:00'}</strong> <span class="s-c-title">近7日单设备日均使用时长</span>
<div class="col-md-2" onclick="gettotal(5,'#duration7')">
<strong class="s-c-orange" id = "duration7">加载中...</strong> <span class="s-c-title">近7日单设备日均使用时长</span>
</div>
</div>
@ -131,7 +131,7 @@
<li class="<eq name='num' value='4'>datapick_active</eq>"><a href="{:U('device_survey',array('tb'=>I('tb'),'type'=>I('type'),'category'=>I('category'),'start'=>date('Y-m-d',mktime(0,0,0,date('m')-1,1,date('Y'))),'end'=>date('Y-m-d',mktime(0,0,0,date('m'),1,date('Y'))-1),'num'=>4))}">过去整月</a></li>
<li class="<eq name='num' value='5'>datapick_active</eq>"><a href="{:U('device_survey',array('tb'=>I('tb'),'type'=>I('type'),'category'=>I('category'),'start'=>date('Y-m-d',strtotime('-7 day')),'end'=>date('Y-m-d',strtotime('-1 day')),'num'=>5))}">过去7天</a></li>
<li class="<eq name='num' value='6'>datapick_active</eq>"><a href="{:U('device_survey',array('tb'=>I('tb'),'type'=>I('type'),'category'=>I('category'),'start'=>date('Y-m-d',strtotime('-30 day')),'end'=>date('Y-m-d',strtotime('-1 day')),'num'=>6))}">过去30天</a></li>
<li class="<eq name='num' value='7'>datapick_active</eq>"><a href="{:U('device_survey',array('tb'=>I('tb'),'type'=>I('type'),'category'=>I('category'),'start'=>date('Y-m-d',strtotime('-365 day')),'end'=>date('Y-m-d',strtotime('-1 day')),'num'=>7))}">过去一年</a></li>
<!-- <li class="<eq name='num' value='7'>datapick_active</eq>"><a href="{:U('device_survey',array('tb'=>I('tb'),'type'=>I('type'),'category'=>I('category'),'start'=>date('Y-m-d',strtotime('-365 day')),'end'=>date('Y-m-d',strtotime('-1 day')),'num'=>7))}">过去一年</a></li>-->
</ul>
<div class="range_inputs">
<button class="applyBtn pt-btn btn-success js_determine" type="button">确定</button>
@ -457,7 +457,37 @@
<script src="__JS__/zwmjs/highcharts.js"></script>
<script>
var datelist;
function gettotal(types,ids) {
$(ids).text("加载中...");
$(ids).css('color','#FBA10D');
$.ajax({
type:'post',
dataType:'json',
url:'{:U("stat/getDevice")}',
data:{type:types},
success:function(data) {
$(ids).text(data)
},error:function() {
$(ids).text("加载失败");
$(ids).css('color','red');
layer.msg('服务器错误,请稍候再试');that.removeClass('disabled');
}
});
}
$(function() {
gettotal(0,'#total');
gettotal(1,'#today');
gettotal(2,'#yesterday');
gettotal(3,'#day7');
gettotal(4,'#day30');
gettotal(5,'#duration7');
$('.data-box').each(function() {
var that = $(this);
if (that.width()>that.find('.data-wrap').width()) {

@ -16,6 +16,7 @@ use Think\Controller;
*/
class AddonsController extends Controller{
public function _initialize(){
/* 读取数据库中的配置 */
$config = S('DB_CONFIG_DATA');

@ -19,7 +19,7 @@ class SsgController extends BaseController {
const CODE_ERROR = -97; //验证码错误
const RETURN_SUCCESS = 1;
const RETURN_FALSE = 2;
const signprice = 0.01; //充值金额
const signprice = 0.1; //充值金额
public function login()
@ -566,13 +566,12 @@ class SsgController extends BaseController {
$param['body'] = $price;
//$param['callback'] = "https://m.wmtxkj.com/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
//$param['notifyurl'] = "https://m.wmtxkj.com/callback.php/Notify/notify/apitype/alipay";
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
$param['callback'] = "http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
// $param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
$param['notifyurl'] = "http://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}else{
$param['callback'] = "https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/{$userId}/game_id/{$gameId}/order_id/{$orderId}";
// $param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
$param['notifyurl'] = "https://".$_SERVER['HTTP_HOST']."/callback.php/Notify/notify/apitype/alipay";
}
$ali_pay = $this->alipay($param);
@ -604,7 +603,7 @@ class SsgController extends BaseController {
->setTable("supersign")
->setPayWay($param['payway'])
->setCallback($param['callback'])
// ->setNotifyUrl($param['notifyurl'])
->setNotifyUrl($param['notifyurl'])
->setGameName(get_game_name($param['game_id']))
->setServerId(0)
->setUserId($param['user_id'])

@ -451,6 +451,8 @@ CREATE TABLE `tab_index_chart` (
PRIMARY KEY (`id`),
KEY `date` (`date`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='首页折线图静态数据';
-- 添加登录日统计表
CREATE TABLE `tab_login_daily_record` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
@ -474,6 +476,56 @@ ALTER TABLE `tab_promote`
CHANGE COLUMN `ver_status` `ver_status` INT(11) NULL DEFAULT '0' COMMENT '资质认证审核状态(1是审核成功2审核失败3未审核,4修改认证)' AFTER `child_game_permission`,
ADD COLUMN `anothpic` CHAR(254) NULL DEFAULT NULL AFTER `account_type`;
--2019-11-19 chenzhi
CREATE TABLE `tab_index_chart` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增',
`date` int(11) NOT NULL DEFAULT '0' COMMENT '日期时间戳',
`new_user_hours` varchar(500) NOT NULL DEFAULT '' COMMENT '新增用户聚合',
`new_user_count` int(11) NOT NULL DEFAULT '0' COMMENT '单日新增总计',
`active_user_hours` varchar(500) NOT NULL DEFAULT '' COMMENT '活跃用户聚合',
`active_user_count` int(11) NOT NULL DEFAULT '0' COMMENT '单日活跃总计',
`active_user_list` longtext COMMENT '单日活跃用户的id序列',
`pay_user_hours` varchar(500) NOT NULL DEFAULT '' COMMENT '付费用户聚合',
`pay_user_count` int(11) NOT NULL DEFAULT '0' COMMENT '单日付费用户总计',
`pay_user_list` longtext COMMENT '单日付费用户的id序列',
`pay_money_hours` varchar(500) NOT NULL DEFAULT '' COMMENT '付费金额聚合',
`pay_money_count` decimal(10,2) DEFAULT '0.00' COMMENT '单日付费金额总计',
`promote_new_hours` varchar(500) NOT NULL DEFAULT '' COMMENT '小时新增渠道',
`promote_new_count` int(11) NOT NULL DEFAULT '0' COMMENT '新增合作渠道总计',
`all_count` varchar(500) NOT NULL DEFAULT '' COMMENT '累计的统计数据',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '统计日期',
PRIMARY KEY (`id`),
KEY `date` (`date`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='首页折线图静态数据';
-- 2019-11-20 zyx
DROP TABLE IF EXISTS `tab_device_statistics`;
CREATE TABLE `tab_device_statistics` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` int(11) NOT NULL DEFAULT 0 COMMENT '日期时间戳',
`new_device` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增设备',
`active_device` int(11) NOT NULL DEFAULT 0 COMMENT '当日活跃设备',
`today_new_device` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '当日新增设备按小时划分的json字符串',
`today_active_device` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '当日活跃设备按小时划分的json字符串',
`today_model_device` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '当日启动机型(机型,系统,数量)',
`model` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '当日启动设备',
`version` int(11) NOT NULL DEFAULT 1 COMMENT '机型',
`duration7` int(255) NOT NULL DEFAULT 0 COMMENT '七天的平均使用时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `time`(`time`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 163 CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `platform`.`tab_device_record`
ADD INDEX `create_time`(`create_time`) USING BTREE,
ADD INDEX `unique_code`(`unique_code`) USING BTREE,
ADD INDEX `idx_unique_version`(`version`, `unique_code`) USING BTREE,
ADD INDEX `version`(`version`) USING BTREE;
UPDATE `platform_new`.`tab_quick_menu` SET `url` = '/index.php?s=/Home/TestResource/index.html' WHERE `id` = 11
UPDATE `platform_new`.`tab_quick_menu` SET `url` = '/index.php?s=/Home/TestResource/lists.html' WHERE `id` = 12
--
ALTER TABLE `tab_withdraw`
ADD INDEX `widthdraw_number`(`widthdraw_number`);

Loading…
Cancel
Save