优化首页

master
chenzhi 4 years ago
parent 0e54b1c376
commit b6c87bfefe

@ -123,5 +123,6 @@ return array(
"tab_company_lack_statement_info",
"tab_company_statement_info",
"tab_company_statement_pool",
"tab_financial_summary"
]
);

@ -35,7 +35,7 @@ class IndexChartSetController extends AdminController {
$this->UserModel =M("User","tab_");
$this->ChartModel =SM("IndexChart","tab_");
$this->LoginModel =M("user_login_record","tab_");
$this->SpendModel =SM("spend","tab_");
$this->SpendModel =M("spend","tab_");
$this->PromoteModel =M("promote","tab_");
$this->nowdata =time();
if(I("reset")) $this->reset = true;
@ -191,6 +191,7 @@ class IndexChartSetController extends AdminController {
}
$this->adddata["pay_user_hours"] = json_encode($user_hours);
unset($user_hours);
D("Spend")->addSubsiteWhere($map);
$activeCount = $this->SpendModel->field('user_id')
->where($map)
->group('user_id')
@ -206,6 +207,7 @@ class IndexChartSetController extends AdminController {
public function payMoney()
{
$map = ['pay_time'=>['between',[$this->beginTime,$this->endTime]],"pay_status"=>1];//1支付成功
D("Spend")->addSubsiteWhere($map);
$hoursnews = $this->SpendModel->field('FROM_UNIXTIME(pay_time, "%H") as time,sum(pay_amount) AS money')
->where($map)
->group("time")
@ -278,7 +280,10 @@ class IndexChartSetController extends AdminController {
$allcount['android_gamesource_count'] = M("GameSource","tab_")->where("file_type = 1")->field("count(1) game_count")->find()['game_count'];//安卓游戏原包
$allcount['ios_gamesource_count'] = M("GameSource","tab_")->where("file_type = 2")->field("count(1) game_count")->find()['game_count'];//IOS游戏原包
$allcount['promote_user_count'] = $user->where("promote_id > 0 and puid = 0")->field("count(1) user_count")->find()['user_count'];//推广员注册用户
$allcount['promote_spend_sum'] = $spend->where("promote_id > 0 and pay_status = 1")->field("sum(pay_amount) pay_amount")->find()['pay_amount'];//推广员总充值
$promoteMap = [];
D("Spend")->addSubsiteWhere($promoteMap);
$allcount['promote_spend_sum'] = $spend->where("promote_id > 0 and pay_status = 1")->where($promoteMap)->field("sum(pay_amount) pay_amount")->find()['pay_amount'];//推广员总充值
$this->adddata["all_count"] = json_encode($allcount);
}

@ -565,7 +565,7 @@ class SpendModel extends Model
}
$map['pay_status'] = 1;
$this->addSubsiteWhere($map);
$data = $this->field('FROM_UNIXTIME(pay_time,"' . $dateform . '") as ' . $group . ',sum(pay_amount) as ' . $fieldname)
->where($map)->group($group)->order($order)->select();
@ -670,6 +670,7 @@ class SpendModel extends Model
}
$map['pay_status'] = 1;
$this->addSubsiteWhere($map);
$data = $this->field('FROM_UNIXTIME(pay_time,"' . $dateform . '") as ' . $group . ',count( DISTINCT user_id) as ' . $fieldname)
@ -760,6 +761,7 @@ class SpendModel extends Model
{
$map['pay_status'] = 1;
$this->addSubsiteWhere($map);
$data = $this->field('count( DISTINCT user_id) as count')
->where($map)->select();
@ -777,7 +779,7 @@ class SpendModel extends Model
{
$map['pay_status'] = 1;
$this->addSubsiteWhere($map);
$data = $this
->where($map)->sum('pay_amount');

Loading…
Cancel
Save