|
|
@@ -71,14 +71,18 @@ class IndexController extends Controller
|
|
|
if (\App\Models\Role::hasRoot('/enable/show/bet_count') < 0) {
|
|
|
$bet_count['count'] = "*****";
|
|
|
} else {
|
|
|
+ //串式投注
|
|
|
$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_count['money_count'] = "*****";
|
|
|
} else {
|
|
|
+ //串式投注
|
|
|
$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);
|
|
|
@@ -89,7 +93,9 @@ class IndexController extends Controller
|
|
|
} else {
|
|
|
$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++){
|
|
|
@@ -102,9 +108,6 @@ class IndexController extends Controller
|
|
|
}
|
|
|
}
|
|
|
$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);
|
|
|
@@ -296,20 +299,26 @@ class IndexController extends Controller
|
|
|
//今日投注统计饼状图
|
|
|
function getBetUrl()
|
|
|
{
|
|
|
- $db = new \App\Models\OrderUrl;
|
|
|
- $data = $db->getUrlBet();
|
|
|
- $array['data'] = $data;
|
|
|
- if (empty($data)) {
|
|
|
+// $db = new \App\Models\OrderUrl;
|
|
|
+// $data = $db->getUrlBet();
|
|
|
+ $count = $this->countBet();
|
|
|
+ //$array['data'] = $data;
|
|
|
+ if ($count['count'] == 0) {
|
|
|
$array['data'][0]['name'] = '没有';
|
|
|
$array['data'][0]['value'] = 0;
|
|
|
}
|
|
|
+ else{
|
|
|
+ $array['data'][0]['name'] = '今日注单数量';
|
|
|
+ $array['data'][0]['value'] = $count['count'];
|
|
|
+ }
|
|
|
//组装标
|
|
|
foreach ($array['data'] as $k => $v) {
|
|
|
$array['title'][$k] = $v['name'];
|
|
|
}
|
|
|
//添加标题
|
|
|
//总投注数量
|
|
|
- $count = $db->gettotal();
|
|
|
+ $count = $this->countBet();
|
|
|
+ $count = $count['count'];
|
|
|
$array['text'] = date('Y-m-d') . trans('common.today_bet_num') . $count;
|
|
|
// dump($array);
|
|
|
return responseToJson($array);
|