|
|
@@ -71,22 +71,40 @@ class IndexController extends Controller
|
|
|
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();
|
|
|
+ $numstr = \App\Models\MoneyBuyStr::where('money_buy_str.status', '<>', 4)->join('account', 'money_buy_str.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->count();
|
|
|
+ $numsimplex = \App\Models\MoneyBuySimplex::where('money_buy_simplex.status', '<>', 4)->join('account', 'money_buy_simplex.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_buy_simplex.money_time', $timearea)->count();
|
|
|
+ $bet_count['count'] = $numstr+$numsimplex;
|
|
|
}
|
|
|
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_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');
|
|
|
+ $str_bet_money = \App\Models\MoneyBuyStr::where('money_buy_str.status', '<>', 4)->join('account', 'money_buy_str.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
+ $simplex_bet_money = \App\Models\MoneyBuySimplex::where('money_buy_simplex.status', '<>', 4)->join('account', 'money_buy_simplex.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->sum('money');
|
|
|
+ $bet_money = $str_bet_money+$simplex_bet_money;
|
|
|
$bet_count['money_count'] = round($bet_money, 2);
|
|
|
}
|
|
|
// DB::connection()->enableQueryLog();
|
|
|
if (\App\Models\Role::hasRoot('/enable/show/countBet') < 0) {
|
|
|
- $db = new \App\Models\MoneyBuy;
|
|
|
$bet_count['user_count'] = "*****";
|
|
|
} else {
|
|
|
- $db = new \App\Models\MoneyBuy;
|
|
|
- $bet_count['user_count'] = $db->countUser($timearea);
|
|
|
+ $db = new \App\Models\MoneyBuyStr;
|
|
|
+ $db1 = new \App\Models\MoneyBuySimplex;
|
|
|
+ $str = $db->countUser($timearea);
|
|
|
+ $simplex = $db1->countUser($timearea);
|
|
|
+ if($str && $simplex){
|
|
|
+ for($i=0;$i<count($str);$i++){
|
|
|
+ for($j=0;$j<count($simplex);$j++){
|
|
|
+ if($str[$i]['account_identity'] == $simplex[$j]['account_identity']){
|
|
|
+ unset($str[$i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $bet_count['user_count'] = count($str)+count($simplex);
|
|
|
+// $usernumstr = \App\Models\MoneyBuyStr::select('account_name')->where('money_buy_str.status', '<>', 4)->join('account', 'money_buy_str.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->groupBy('account_name')->count();
|
|
|
+// $usernumsimplex = \App\Models\MoneyBuySimplex::select('account_name')->where('money_buy_simplex.status', '<>', 4)->join('account', 'money_buy_simplex.account_identity', '=', 'account.identity')->where('account.status', '<>', '4')->where('account.user_type', '1')->whereBetween('money_time', $timearea)->groupBy('account_name')->count();
|
|
|
+// $bet_count['user_count'] = $usernumstr+$usernumsimplex;
|
|
|
}
|
|
|
// $queries = DB::getQueryLog();
|
|
|
// print_r($queries);
|
|
|
@@ -328,6 +346,7 @@ class IndexController extends Controller
|
|
|
$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');
|
|
|
+ //var_dump($user);exit;
|
|
|
// if (!empty($user)) {
|
|
|
$userData = [];
|
|
|
foreach ($user as $k => $v) {
|
|
|
@@ -342,9 +361,13 @@ class IndexController extends Controller
|
|
|
$days = ($etimestamp - $stimestamp) / 86400;
|
|
|
//保存每天日期
|
|
|
$date = array();
|
|
|
- for ($i = 0; $i < $days; $i++) {
|
|
|
+ for ($i = 1; $i <= $days; $i++) {
|
|
|
$date[] = date('Y-m-d', $stimestamp + (86400 * $i));
|
|
|
}
|
|
|
+ // $time = [$date[0], $date[$days-1].' 23:59:59'];
|
|
|
+ // $num = \App\Models\Account_detailed::whereBetween('register_time', $time)->get()->toArray();
|
|
|
+ // var_dump($num);exit;
|
|
|
+
|
|
|
//循环补全日期
|
|
|
foreach ($date as $key => $val) {
|
|
|
$data[$key] = [
|