From ae0334743777fd51de9e929d890091d9cde5cae9 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Fri, 29 Nov 2019 15:44:11 +0800 Subject: [PATCH] 123 --- .../Admin/Controller/StatisticsController.class.php | 11 ++++++----- .../Controller/StatisticsCountSetController.class.php | 8 +++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/StatisticsController.class.php b/Application/Admin/Controller/StatisticsController.class.php index 25aa243bf..a91a95382 100644 --- a/Application/Admin/Controller/StatisticsController.class.php +++ b/Application/Admin/Controller/StatisticsController.class.php @@ -275,11 +275,12 @@ class StatisticsController extends ThinkController { private function promote_data_order($starttime,$endtime){ //注册排行 - $IndexChart = M("IndexChart","tab_"); - // - $map = array( - "date"=>['between',[$starttime,$endtime]] - ); + $PromoteCount = M("PromoteCount","tab_"); + + //获取当前注册前十名 + $new_user_count = $PromoteCount->field("promote_account,new_user_count")->where("`date` {$starttime}")->order("new_user_count desc")->limit(10)->select(false); + echo "
";dump($new_user_count);die();
+
 
 
 	}
diff --git a/Application/Admin/Controller/StatisticsCountSetController.class.php b/Application/Admin/Controller/StatisticsCountSetController.class.php
index 0af3eecb4..8ecc04940 100644
--- a/Application/Admin/Controller/StatisticsCountSetController.class.php
+++ b/Application/Admin/Controller/StatisticsCountSetController.class.php
@@ -100,6 +100,8 @@ class StatisticsCountSetController extends Controller {
 		$this->promotePayMoeny();
 		$this->promoteActive();
 		$this->promoteCreateDb();
+		unset($this->addid);
+		unset($this->adddata);
 		$this->addid = [];
 		$this->adddata = [];
         $this->gameNew();
@@ -116,7 +118,7 @@ class StatisticsCountSetController extends Controller {
    //1聚合新增
    public function promoteNew()
    {
-	$map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"promote_id"=>["gt",0]];//0不是小号
+	$map = ['register_time'=>['between',[$this->beginTime,$this->endTime]],"puid"=>0,"promote_id"=>["gt",0]];
 	$promoteNew = $this->UserModel->field('COUNT(1) AS new_user_count,promote_id,promote_account')
 				->where($map)
 				->group("promote_id")
@@ -177,7 +179,7 @@ class StatisticsCountSetController extends Controller {
 			foreach ($this->adddata as $key => $value) {
 				$value['date']=$this->beginTime;
 				$value['create_time']=$this->nowdata;
-				$value['active_user_list'] = @json_encode(explode(",",$value['active_user_list']));
+				$value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list'])));
 				if(empty($value['promote_account']) && $value['promote_id']){
 					$value['promote_account'] =  $this->PromoteModel->field("account")->where("id = {$value['promote_id']}")->find()['account'];
 				}
@@ -254,7 +256,7 @@ class StatisticsCountSetController extends Controller {
 			foreach ($this->adddata as $key => $value) {
 				$value['date']=$this->beginTime;
 				$value['create_time']=$this->nowdata;
-				$value['active_user_list'] = @json_encode(explode(",",$value['active_user_list']));
+				$value['active_user_list'] = @json_encode(array_map("intFun",explode(",",$value['active_user_list'])));
 				$tempdbres = $this->GameCountModel->add($value);
 				if($tempdbres === false){
 					$this->model->rollback();