master
chenzhi 5 years ago
parent 74ff06d549
commit ae03347437

@ -275,11 +275,12 @@ class StatisticsController extends ThinkController {
private function promote_data_order($starttime,$endtime){ private function promote_data_order($starttime,$endtime){
//注册排行 //注册排行
$IndexChart = M("IndexChart","tab_"); $PromoteCount = M("PromoteCount","tab_");
//
$map = array( //获取当前注册前十名
"date"=>['between',[$starttime,$endtime]] $new_user_count = $PromoteCount->field("promote_account,new_user_count")->where("`date` {$starttime}")->order("new_user_count desc")->limit(10)->select(false);
); echo "<pre>";dump($new_user_count);die();
} }

@ -100,6 +100,8 @@ class StatisticsCountSetController extends Controller {
$this->promotePayMoeny(); $this->promotePayMoeny();
$this->promoteActive(); $this->promoteActive();
$this->promoteCreateDb(); $this->promoteCreateDb();
unset($this->addid);
unset($this->adddata);
$this->addid = []; $this->addid = [];
$this->adddata = []; $this->adddata = [];
$this->gameNew(); $this->gameNew();
@ -116,7 +118,7 @@ class StatisticsCountSetController extends Controller {
//1聚合新增 //1聚合新增
public function promoteNew() 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') $promoteNew = $this->UserModel->field('COUNT(1) AS new_user_count,promote_id,promote_account')
->where($map) ->where($map)
->group("promote_id") ->group("promote_id")
@ -177,7 +179,7 @@ class StatisticsCountSetController extends Controller {
foreach ($this->adddata as $key => $value) { foreach ($this->adddata as $key => $value) {
$value['date']=$this->beginTime; $value['date']=$this->beginTime;
$value['create_time']=$this->nowdata; $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']){ if(empty($value['promote_account']) && $value['promote_id']){
$value['promote_account'] = $this->PromoteModel->field("account")->where("id = {$value['promote_id']}")->find()['account']; $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) { foreach ($this->adddata as $key => $value) {
$value['date']=$this->beginTime; $value['date']=$this->beginTime;
$value['create_time']=$this->nowdata; $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); $tempdbres = $this->GameCountModel->add($value);
if($tempdbres === false){ if($tempdbres === false){
$this->model->rollback(); $this->model->rollback();

Loading…
Cancel
Save