|
|
@@ -215,8 +215,8 @@ class MoneyBuyStr extends BaseModel
|
|
|
//投注金额汇总统计
|
|
|
function MoneyCount($where = '',$match_id='',$game_code='')
|
|
|
{
|
|
|
+ $data = array();
|
|
|
if(empty($match_id)){
|
|
|
- $data = array();
|
|
|
$data['all_money'] = $this->where('status', '1')->sum('money');
|
|
|
$data['all_prize_money'] = $this->where('status', '1')->sum('prize_money');
|
|
|
$data['alraedy_prize_money'] = $this->where('settle_status', '2')->where('status', '1')->sum('gain_money');
|
|
|
@@ -226,16 +226,27 @@ class MoneyBuyStr extends BaseModel
|
|
|
$data['alraedy_prize_money'] = $this->where($where)->where('settle_status', '2')->where('status', '1')->sum('gain_money');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//追加 如果有赛事id+球类代码 则查询该赛事下所有串式投注
|
|
|
if(!empty($game_code) and !empty($match_id)){
|
|
|
- $where = ['game_code'=>$game_code,'match_id'=>$match_id,'bet_type'=>2];
|
|
|
+ $where_match = ['game_code'=>$game_code,'match_id'=>$match_id,'bet_type'=>2];
|
|
|
$moneyBuyMatch = new MoneyBuyMatchModel();
|
|
|
- $str_order_ids = $moneyBuyMatch->getByAttrs($where)->toArray();
|
|
|
+ $str_order_ids = $moneyBuyMatch->getByAttrs($where_match)->toArray();
|
|
|
|
|
|
+
|
|
|
if(empty($str_order_ids)){
|
|
|
$data['all_money'] = 0;
|
|
|
$data['all_prize_money'] = 0;
|
|
|
$data['alraedy_prize_money'] = 0;
|
|
|
+ }else{
|
|
|
+ $data['all_money'] = $this->where('status', '1')->sum('money');
|
|
|
+ $data['all_prize_money'] = $this->where('status', '1')->sum('prize_money');
|
|
|
+ $data['alraedy_prize_money'] = $this->where('settle_status', '2')->where('status', '1')->sum('gain_money');
|
|
|
+ if (!empty($where) && is_array($where)) {
|
|
|
+ $data['all_money'] = $this->where($where)->where('status', '1')->sum('money');
|
|
|
+ $data['all_prize_money'] = $this->where($where)->where('status', '1')->sum('prize_money');
|
|
|
+ $data['alraedy_prize_money'] = $this->where($where)->where('settle_status', '2')->where('status', '1')->sum('gain_money');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|