|
|
@@ -9,9 +9,11 @@ use Illuminate\Support\Facades\DB;
|
|
|
/**
|
|
|
*
|
|
|
*/
|
|
|
-class IndexController extends Controller {
|
|
|
+class IndexController extends Controller
|
|
|
+{
|
|
|
|
|
|
- function welcome() {
|
|
|
+ function welcome()
|
|
|
+ {
|
|
|
$total = array(
|
|
|
'total_user' => $this->countTodayUser(),
|
|
|
'total_bet' => $this->countBet(),
|
|
|
@@ -31,12 +33,14 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//返回用户数量
|
|
|
- function countUser() {
|
|
|
+ function countUser()
|
|
|
+ {
|
|
|
return \App\Models\Account_detailed::count();
|
|
|
}
|
|
|
|
|
|
//今日注册用户数量
|
|
|
- function countTodayUser() {
|
|
|
+ function countTodayUser()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -59,20 +63,21 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//注单总数量
|
|
|
- function countBet() {
|
|
|
+ function countBet()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
if (\App\Models\Role::hasRoot('/enable/show/bet_count') < 0) {
|
|
|
$bet_count['count'] = "*****";
|
|
|
} else {
|
|
|
- $bet_count['count'] = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type','1')->whereBetween('money_time', $timearea)->count();
|
|
|
+ $bet_count['count'] = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->count();
|
|
|
}
|
|
|
if (\App\Models\Role::hasRoot('/enable/show/bet_money') < 0) {
|
|
|
- $bet_money = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type','1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
+ $bet_money = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
$bet_count['money_count'] = "*****";
|
|
|
} else {
|
|
|
- $bet_money = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type','1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
+ $bet_money = \App\Models\MoneyBuy::where('money_buy.status', '<>', 4)->join('account', 'money_buy.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
$bet_count['money_count'] = round($bet_money, 2);
|
|
|
}
|
|
|
// DB::connection()->enableQueryLog();
|
|
|
@@ -89,7 +94,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//今日提现
|
|
|
- function countTodayTake() {
|
|
|
+ function countTodayTake()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -119,7 +125,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//今日充值笔数
|
|
|
- function countTodayRecharge() {
|
|
|
+ function countTodayRecharge()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -154,7 +161,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
// 今日回水笔数
|
|
|
- function countTodayReturn() {
|
|
|
+ function countTodayReturn()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -180,7 +188,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
// 今日反水笔数
|
|
|
- function countTodayBack() {
|
|
|
+ function countTodayBack()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -203,7 +212,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//今日汇款
|
|
|
- function countTodayRimt() {
|
|
|
+ function countTodayRimt()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00'); //今日0时
|
|
|
$time2 = date('Y-m-d 23:59:59'); //
|
|
|
$timearea = [$time1, $time2];
|
|
|
@@ -228,7 +238,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//公告信息
|
|
|
- function getNotice() {
|
|
|
+ function getNotice()
|
|
|
+ {
|
|
|
$db = new \App\Models\Article();
|
|
|
$data = $db->getMsg(2, 2);
|
|
|
|
|
|
@@ -236,7 +247,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//当前在线用户饼状图
|
|
|
- function onlineUser() {
|
|
|
+ function onlineUser()
|
|
|
+ {
|
|
|
// $db = new \App\Model\Logfile;
|
|
|
// $db=new \App\Model\Account_Token;
|
|
|
$db = new \App\Models\Account_detailed;
|
|
|
@@ -264,7 +276,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//今日投注统计饼状图
|
|
|
- function getBetUrl() {
|
|
|
+ function getBetUrl()
|
|
|
+ {
|
|
|
$db = new \App\Models\OrderUrl;
|
|
|
$data = $db->getUrlBet();
|
|
|
$array['data'] = $data;
|
|
|
@@ -285,7 +298,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//时间区
|
|
|
- function getTime() {
|
|
|
+ function getTime()
|
|
|
+ {
|
|
|
$time = array(
|
|
|
'addrss' => date_default_timezone_get(),
|
|
|
'time' => date("Y-m-d H:i:s", time() + 3600 * 8),
|
|
|
@@ -295,7 +309,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//最近7天会员注册情况
|
|
|
- function regUser() {
|
|
|
+ function regUser()
|
|
|
+ {
|
|
|
/*
|
|
|
$time2 = date('Y-m-d H:i:s', time() - 60 * 60 * 24 * 30);
|
|
|
$time1 = date('Y-m-d H:i:s', time());
|
|
|
@@ -307,17 +322,18 @@ class IndexController extends Controller {
|
|
|
$data = $rimit->toArray();
|
|
|
*/
|
|
|
|
|
|
+
|
|
|
//统计七天内注册用户数量按天进行分组
|
|
|
$start_time = date('Y-m-d', strtotime('-7 days'));
|
|
|
- $end_time = date('Y-m-d',time());
|
|
|
- $user = DB::table('account_detailed')->whereBetween('register_time',[$start_time,$end_time])
|
|
|
- ->selectRaw('date(register_time) as name,count(identity) as value')
|
|
|
- ->groupBy('register_time')->get();
|
|
|
- if(!empty($user)){
|
|
|
+ $end_time = date('Y-m-d', time());
|
|
|
+
|
|
|
+ $user = DB::select('select rtime as name ,count(rtime) as value from (SELECT to_char( "register_time",\'YYYY-MM-DD\') as rtime FROM "account_detailed" where "register_time">=CURRENT_DATE-7) as tmp group by rtime order by name asc');
|
|
|
+
|
|
|
+ if (!empty($user)) {
|
|
|
$userData = [];
|
|
|
- foreach($user as $k=>$v){
|
|
|
- $userData[$k]['name'] = $v->name;
|
|
|
- $userData[$k]['value'] = $v->value;
|
|
|
+ foreach ($user as $k => $v) {
|
|
|
+ $userData[$k]['name'] = $v->name;
|
|
|
+ $userData[$k]['value'] = $v->value;
|
|
|
}
|
|
|
}
|
|
|
//计算日期内天数
|
|
|
@@ -327,17 +343,17 @@ class IndexController extends Controller {
|
|
|
$days = ($etimestamp - $stimestamp) / 86400;
|
|
|
//保存每天日期
|
|
|
$date = array();
|
|
|
- for($i = 0;$i < $days;$i++){
|
|
|
+ for ($i = 0; $i < $days; $i++) {
|
|
|
$date[] = date('Y-m-d', $stimestamp + (86400 * $i));
|
|
|
}
|
|
|
//循环补全日期
|
|
|
- foreach ($date as $key => $val){
|
|
|
+ foreach ($date as $key => $val) {
|
|
|
$data[$key] = [
|
|
|
- 'name' => $val,
|
|
|
- 'value' => 0
|
|
|
+ 'name' => $val,
|
|
|
+ 'value' => 0
|
|
|
];
|
|
|
- foreach ($userData as $item => $value){
|
|
|
- if($val == $value['name']){
|
|
|
+ foreach ($userData as $item => $value) {
|
|
|
+ if ($val == $value['name']) {
|
|
|
$data[$key] = $value;
|
|
|
}
|
|
|
}
|
|
|
@@ -354,7 +370,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//最近7天财务情况
|
|
|
- function money() {
|
|
|
+ function money()
|
|
|
+ {
|
|
|
$res_array = array();
|
|
|
|
|
|
for ($i = 6; $i >= 0; $i--) {
|
|
|
@@ -448,7 +465,8 @@ class IndexController extends Controller {
|
|
|
return responseToJson($array);*/
|
|
|
}
|
|
|
|
|
|
- private function getTradetype() {
|
|
|
+ private function getTradetype()
|
|
|
+ {
|
|
|
$tradetype = array(
|
|
|
'5' => 'money_with',
|
|
|
'6' => 'money_recharge',
|
|
|
@@ -460,7 +478,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//每天每个游戏注单数
|
|
|
- function TodayGameNote() {
|
|
|
+ function TodayGameNote()
|
|
|
+ {
|
|
|
$time1 = date('Y-m-d 00:00:00');//今日零时
|
|
|
$time2 = date('Y-m-d 23:59:59');//今日末时
|
|
|
// $time1='2017-09-14 00:00:00';
|
|
|
@@ -482,7 +501,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//拉时间
|
|
|
- function pullTime() {
|
|
|
+ function pullTime()
|
|
|
+ {
|
|
|
//获取前台域名
|
|
|
$setInfo = new \App\Models\Setinfo();
|
|
|
$info = $setInfo->getInfo(18);
|
|
|
@@ -508,7 +528,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//通知消息
|
|
|
- function Message() {
|
|
|
+ function Message()
|
|
|
+ {
|
|
|
|
|
|
$admin_id = session('adminInfo.admin_id');
|
|
|
$db = new \App\Models\MessageRead;
|
|
|
@@ -532,7 +553,8 @@ class IndexController extends Controller {
|
|
|
}
|
|
|
|
|
|
//刷新缓存
|
|
|
- public function refresh() {
|
|
|
+ public function refresh()
|
|
|
+ {
|
|
|
return view('admin.refresh');
|
|
|
}
|
|
|
}
|