|
|
@@ -5,206 +5,215 @@
|
|
|
* Date: 2019/4/9
|
|
|
* Time: 9:18
|
|
|
*/
|
|
|
+
|
|
|
namespace App\Models;
|
|
|
+
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
-class SportsNoteList extends BaseModel {
|
|
|
+use App\Models\MoneyBuyMatch;
|
|
|
+
|
|
|
+class SportsNoteList extends BaseModel
|
|
|
+{
|
|
|
protected $table = "money_buy_simplex";
|
|
|
public $timestamps = false;
|
|
|
|
|
|
- function getinfo($list = 10, $page, $where = '',$type)
|
|
|
+ public function matchdatas()
|
|
|
+ {
|
|
|
+ return $this->hasMany(MoneyBuyMatch::class, 'order_id', 'order_id');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function getinfo($list = 10, $page, $where = '', $type)
|
|
|
{
|
|
|
$data = $this
|
|
|
- ->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')
|
|
|
- ->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')
|
|
|
+ ->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
|
+ ->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
|
// ->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')
|
|
|
- ->join('st_'.$type.'_league','money_buy_simplex.lg_id','=','st_'.$type.'_league.id')
|
|
|
-
|
|
|
- ->select('money_buy_simplex.id','money_buy_simplex.account_name','money_buy_simplex.is_champion','money_buy_simplex.account_identity','money_buy_simplex.order_id','money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.status','money_buy_simplex.money_time','money_buy_simplex.settle_status','money_buy_simplex.gain_money','money_buy_simplex.game_code','money_buy_simplex.match_id','money_buy_simplex.game_status','st_'.$type.'_competition.home_team','st_'.$type.'_competition.guest_team','st_'.$type.'_competition.match_date','st_'.$type.'_competition.match_time','st_'.$type.'_competition.lg_id','st_'.$type.'_competition.status as match_status','money_details.money_cash','money_buy_simplex.batch_id','st_'.$type.'_league.name_chinese','st_'.$type.'_league.last_time')
|
|
|
+ ->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
|
+ ->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
|
->where($where)
|
|
|
- ->orderby('money_buy_simplex.money_time','desc')
|
|
|
- ->paginate ($list);
|
|
|
+ ->orderby('money_buy_simplex.money_time', 'desc')
|
|
|
+ ->paginate($list);
|
|
|
if (!$data < 0) {
|
|
|
return -2021052003; //
|
|
|
}
|
|
|
//反水
|
|
|
- $water_return_money = \App\Models\Money_details::where('trade_type','7')->get();
|
|
|
+ $water_return_money = \App\Models\Money_details::where('trade_type', '7')->get();
|
|
|
|
|
|
//注单作废
|
|
|
- $invalid_money = \App\Models\Money_details::where('trade_type','3')->get();
|
|
|
+ $invalid_money = \App\Models\Money_details::where('trade_type', '3')->get();
|
|
|
|
|
|
//订单投注的玩法
|
|
|
- $content = \App\Models\MoneyBuyMatch::where('bet_type','1')->get();
|
|
|
- for($d=0;$d<count($content);$d++){
|
|
|
- if($content[$d]->result==0){
|
|
|
+ $content = \App\Models\MoneyBuyMatch::where('bet_type', '1')->get();
|
|
|
+ for ($d = 0; $d < count($content); $d++) {
|
|
|
+ if ($content[$d]->result == 0) {
|
|
|
$content[$d]->result = '未处理';
|
|
|
}
|
|
|
- if($content[$d]->result==1){
|
|
|
+ if ($content[$d]->result == 1) {
|
|
|
$content[$d]->result = '赢';
|
|
|
}
|
|
|
- if($content[$d]->result==-1){
|
|
|
+ if ($content[$d]->result == -1) {
|
|
|
$content[$d]->result = '输';
|
|
|
}
|
|
|
- if($content[$d]->result==2){
|
|
|
+ if ($content[$d]->result == 2) {
|
|
|
$content[$d]->result = '平';
|
|
|
}
|
|
|
- if($content[$d]->result==3){
|
|
|
+ if ($content[$d]->result == 3) {
|
|
|
$content[$d]->result = '赢半平半';
|
|
|
}
|
|
|
- if($content[$d]->result==4){
|
|
|
+ if ($content[$d]->result == 4) {
|
|
|
$content[$d]->result = '输半平半';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//玩法
|
|
|
- $result = \App\Models\Matchcode::where('game_code',$type)->get();
|
|
|
+ $result = \App\Models\Matchcode::where('game_code', $type)->get();
|
|
|
//$result = \App\Model\Matchcode::get();
|
|
|
|
|
|
|
|
|
- for($i=0;$i<count($data);$i++){
|
|
|
+ for ($i = 0; $i < count($data); $i++) {
|
|
|
// if($data[$i]->status==1 && $data[$i]->game_status==0){
|
|
|
- // $data[$i]->order_status = '投注'.'<br>;<a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id='.$data[$i]->id.'\');"> 作废 </a>';
|
|
|
+ // $data[$i]->order_status = '投注'.'<br>;<a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id='.$data[$i]->id.'\');"> 作废 </a>';
|
|
|
// }else
|
|
|
- if($data[$i]->status==1 && $data[$i]->game_status==0){
|
|
|
+ if ($data[$i]->status == 1 && $data[$i]->game_status == 0) {
|
|
|
$data[$i]->order_status = '投注';
|
|
|
- }else if($data[$i]->status==2){
|
|
|
+ } else if ($data[$i]->status == 2) {
|
|
|
$data[$i]->order_status = '作废';//.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
|
|
|
- }else if($data[$i]->status==3){
|
|
|
+ } else if ($data[$i]->status == 3) {
|
|
|
$data[$i]->order_status = '撤单';//.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已撤单 </a>';
|
|
|
}
|
|
|
- if($data[$i]->settle_status==1){
|
|
|
+ if ($data[$i]->settle_status == 1) {
|
|
|
$data[$i]->settle_status = '未结算';
|
|
|
- }else if($data[$i]->settle_status==2){
|
|
|
+ } else if ($data[$i]->settle_status == 2) {
|
|
|
$data[$i]->settle_status = '已结算';
|
|
|
}
|
|
|
- if($data[$i]->game_status==0){
|
|
|
+ if ($data[$i]->game_status == 0) {
|
|
|
$data[$i]->game_status = '未处理';
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$data[$i]->game_status = '已处理';
|
|
|
}
|
|
|
|
|
|
- if($data[$i]->game_code == 'zq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'zq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'lq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'lq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'wq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'wq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'bq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'bq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
|
|
|
$data[$i]->league = $data[$i]->name_chinese;
|
|
|
|
|
|
|
|
|
- if($data[$i]->is_champion == 0){
|
|
|
- $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
|
|
|
- $data[$i]->time = '开赛:'.$data[$i]->match_date.' '.$data[$i]->match_time;
|
|
|
- }else{
|
|
|
+ if ($data[$i]->is_champion == 0) {
|
|
|
+ $data[$i]->home_guest = $data[$i]->home_team . ' VS ' . $data[$i]->guest_team;
|
|
|
+ $data[$i]->time = '开赛:' . $data[$i]->match_date . ' ' . $data[$i]->match_time;
|
|
|
+ } else {
|
|
|
$data[$i]->home_guest = '冠军联赛投注';
|
|
|
- $data[$i]->time = '结束:'.$data[$i]->last_time;
|
|
|
+ $data[$i]->time = '结束:' . $data[$i]->last_time;
|
|
|
|
|
|
}
|
|
|
- $data[$i]->money_match_time = '下注:'.$data[$i]->money_time.$data[$i]->time;
|
|
|
+ $data[$i]->money_match_time = '下注:' . $data[$i]->money_time . $data[$i]->time;
|
|
|
|
|
|
//反水
|
|
|
$data[$i]->water_return = -1;
|
|
|
- for($a=0;$a<count($water_return_money);$a++){
|
|
|
- if($data[$i]->order_id == $water_return_money[$a]->trade_id){
|
|
|
- if($data[$i]->status == 2 || $data[$i]->status == 3){
|
|
|
+ for ($a = 0; $a < count($water_return_money); $a++) {
|
|
|
+ if ($data[$i]->order_id == $water_return_money[$a]->trade_id) {
|
|
|
+ if ($data[$i]->status == 2 || $data[$i]->status == 3) {
|
|
|
$data[$i]->water_return = 0;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$data[$i]->water_return = $water_return_money[$a]->money;
|
|
|
}
|
|
|
//用户投注后账户金额
|
|
|
$data[$i]->frozen_cash = $water_return_money[$a]->money_cash;
|
|
|
}
|
|
|
}
|
|
|
- if($data[$i]->water_return == -1){
|
|
|
+ if ($data[$i]->water_return == -1) {
|
|
|
$data[$i]->water_return = 0;
|
|
|
//用户投注后账户金额
|
|
|
$data[$i]->frozen_cash = $data[$i]->money_cash;
|
|
|
}
|
|
|
//此时结果金额
|
|
|
- $data[$i]->result = $data[$i]->water_return+$data[$i]->gain_money;
|
|
|
+ $data[$i]->result = $data[$i]->water_return + $data[$i]->gain_money;
|
|
|
//用户投注前账户金额
|
|
|
- $data[$i]->available_cash = $data[$i]->money_cash+$data[$i]->money;
|
|
|
+ $data[$i]->available_cash = $data[$i]->money_cash + $data[$i]->money;
|
|
|
//投注前后账户金额
|
|
|
- $data[$i]->account_money = $data[$i]->available_cash.'<br><span>'.$data[$i]->money.'</span><br>'.$data[$i]->frozen_cash;
|
|
|
- if($data[$i]->status == 2 || $data[$i]->status == 3){
|
|
|
- for($b=0;$b<count($invalid_money);$b++){
|
|
|
- if($data[$i]->order_id == $invalid_money[$b]->trade_id){
|
|
|
+ $data[$i]->account_money = $data[$i]->available_cash . '<br><span>' . $data[$i]->money . '</span><br>' . $data[$i]->frozen_cash;
|
|
|
+ if ($data[$i]->status == 2 || $data[$i]->status == 3) {
|
|
|
+ for ($b = 0; $b < count($invalid_money); $b++) {
|
|
|
+ if ($data[$i]->order_id == $invalid_money[$b]->trade_id) {
|
|
|
$data[$i]->available_cash = $invalid_money[$b]->money_cash;
|
|
|
$data[$i]->account_money = $data[$i]->available_cash;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$data[$i]->str = 0;
|
|
|
- for($b=0;$b<count($content);$b++){
|
|
|
+ for ($b = 0; $b < count($content); $b++) {
|
|
|
$data[$i]->str1 = 0;
|
|
|
$data[$i]->team = '';
|
|
|
- if(!empty($content[$b]->odds_code)){
|
|
|
- if(!empty(stristr($content[$b]->odds_code,'home'))){
|
|
|
+ if (!empty($content[$b]->odds_code)) {
|
|
|
+ if (!empty(stristr($content[$b]->odds_code, 'home'))) {
|
|
|
$data[$i]->team = $data[$i]->home_team;
|
|
|
}
|
|
|
- if(!empty(stristr($content[$b]->odds_code,'guest'))){
|
|
|
+ if (!empty(stristr($content[$b]->odds_code, 'guest'))) {
|
|
|
$data[$i]->team = $data[$i]->guest_team;
|
|
|
}
|
|
|
|
|
|
- if($content[$b]->p_code == 'half_full'){
|
|
|
- $string = str_replace('home',$data[$i]->home_team,$content[$b]->odds_code);
|
|
|
- $string = str_replace('guest',$data[$i]->guest_team,$string);
|
|
|
- $string = str_replace('dogfall','和局',$string);
|
|
|
- $string = explode('_',$string);
|
|
|
- $data[$i]->team = $string['2'].'/'.$string['3'];
|
|
|
+ if ($content[$b]->p_code == 'half_full') {
|
|
|
+ $string = str_replace('home', $data[$i]->home_team, $content[$b]->odds_code);
|
|
|
+ $string = str_replace('guest', $data[$i]->guest_team, $string);
|
|
|
+ $string = str_replace('dogfall', '和局', $string);
|
|
|
+ $string = explode('_', $string);
|
|
|
+ $data[$i]->team = $string['2'] . '/' . $string['3'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//处理普通赛事玩法详情
|
|
|
- if($data[$i]->match_id == $content[$b]->match_id && $data[$i]->batch_id == $content[$b]->batch_id &&$data[$i]->is_champion == 0){
|
|
|
+ if ($data[$i]->match_id == $content[$b]->match_id && $data[$i]->batch_id == $content[$b]->batch_id && $data[$i]->is_champion == 0) {
|
|
|
|
|
|
- if($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal'){
|
|
|
+ if ($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal') {
|
|
|
$content[$b]->condition = '';
|
|
|
}
|
|
|
|
|
|
$data[$i]->game_status = $data[$i]->game_status;
|
|
|
|
|
|
//投注详情
|
|
|
- if(!empty($data[$i]->match_time)){
|
|
|
- $data[$i]->content1 = '['.$data[$i]->match_time.']';
|
|
|
+ if (!empty($data[$i]->match_time)) {
|
|
|
+ $data[$i]->content1 = '[' . $data[$i]->match_time . ']';
|
|
|
//$data[$i]->match_time = $data[$i]->match_time;
|
|
|
- }
|
|
|
- else{
|
|
|
- if(!empty($data[$i]->last_time)){
|
|
|
- $datetime = explode(' ',$data[$i]->last_time);
|
|
|
+ } else {
|
|
|
+ if (!empty($data[$i]->last_time)) {
|
|
|
+ $datetime = explode(' ', $data[$i]->last_time);
|
|
|
//$data[$i]->match_time = $datetime[1];
|
|
|
- $data[$i]->content1 = '['.$datetime[1].']';
|
|
|
+ $data[$i]->content1 = '[' . $datetime[1] . ']';
|
|
|
}
|
|
|
}
|
|
|
- for($c=0;$c<count($result);$c++){
|
|
|
- if($content[$b]->odds_code == $result[$c]->odds_code){
|
|
|
- $data[$i]->str1 = 1;
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ for ($c = 0; $c < count($result); $c++) {
|
|
|
+ if ($content[$b]->odds_code == $result[$c]->odds_code) {
|
|
|
+ $data[$i]->str1 = 1;
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $data[$i]->content . $result[$c]->odds_name . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $data[$i]->content . $result[$c]->odds_name . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if($data[$i]->str1 == 0){
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ if ($data[$i]->str1 == 0) {
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//处理冠军联赛玩法详情
|
|
|
- if($data[$i]->match_id == $content[$b]->lg_id && $data[$i]->batch_id == $content[$b]->batch_id &&$data[$i]->is_champion == 1){
|
|
|
+ if ($data[$i]->match_id == $content[$b]->lg_id && $data[$i]->batch_id == $content[$b]->batch_id && $data[$i]->is_champion == 1) {
|
|
|
$content[$b]->condition = '';
|
|
|
|
|
|
- if($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal'){
|
|
|
+ if ($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal') {
|
|
|
$content[$b]->condition = '';
|
|
|
}
|
|
|
|
|
|
@@ -236,19 +245,19 @@ class SportsNoteList extends BaseModel {
|
|
|
}
|
|
|
}
|
|
|
*/
|
|
|
- if($data[$i]->str1 == 0){
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $content[$b]->home_team.'<br>'.$data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $content[$b]->home_team.'<br>'.$data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ if ($data[$i]->str1 == 0) {
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $content[$b]->home_team . '<br>' . $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $content[$b]->home_team . '<br>' . $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// if($data[$i]->status == 1){
|
|
|
- // if($data[$i]->match_status == 0 || $data[$i]->match_status == 1){
|
|
|
- // $data[$i]->game_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 结算 </a>';
|
|
|
- // }
|
|
|
+ // if($data[$i]->match_status == 0 || $data[$i]->match_status == 1){
|
|
|
+ // $data[$i]->game_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 结算 </a>';
|
|
|
+ // }
|
|
|
// if($data[$i]->match_status == 2 || $data[$i]->match_status == 3 || $data[$i]->match_status == 5){
|
|
|
// if($data[$i]->settle_status == '已结算'){
|
|
|
// $data[$i]->game_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm resettlement" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/resettlement/?id=" href="javascript:resettlement(\'/admin/SoccerNoteList/resettlement/?id='.$data[$i]->id.'\');"> 重新结算 </a>';
|
|
|
@@ -260,7 +269,7 @@ class SportsNoteList extends BaseModel {
|
|
|
// $data[$i]->game_status = $data[$i]->settle_status.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 结2算 </a>';
|
|
|
// }
|
|
|
|
|
|
- $data[$i]->content = $data[$i]->content1.$data[$i]->content;
|
|
|
+ $data[$i]->content = $data[$i]->content1 . $data[$i]->content;
|
|
|
|
|
|
}
|
|
|
return $data->toArray();
|
|
|
@@ -268,7 +277,8 @@ class SportsNoteList extends BaseModel {
|
|
|
}
|
|
|
|
|
|
//投注金额汇总统计
|
|
|
- function MoneyCount($where = '',$type) {
|
|
|
+ function MoneyCount($where = '', $type)
|
|
|
+ {
|
|
|
$data = array();
|
|
|
// $data['all_money'] = $this->sum('money');
|
|
|
// $data['all_prize_money'] = $this->sum('prize_money');
|
|
|
@@ -276,17 +286,17 @@ class SportsNoteList extends BaseModel {
|
|
|
$data['all_money'] = 0;
|
|
|
$data['all_prize_money'] = 0;
|
|
|
$data['alraedy_prize_money'] = 0;
|
|
|
- $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($all_money);$a++){
|
|
|
- $data['all_money'] = $data['all_money']+$all_money[$a]->money;
|
|
|
+ $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($all_money); $a++) {
|
|
|
+ $data['all_money'] = $data['all_money'] + $all_money[$a]->money;
|
|
|
}
|
|
|
- $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($all_prize_money);$a++){
|
|
|
- $data['all_prize_money'] = $data['all_money']+$all_prize_money[$a]->prize_money;
|
|
|
+ $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($all_prize_money); $a++) {
|
|
|
+ $data['all_prize_money'] = $data['all_money'] + $all_prize_money[$a]->prize_money;
|
|
|
}
|
|
|
- $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($alraedy_prize_money);$a++){
|
|
|
- $data['alraedy_prize_money'] = $data['all_money']+$alraedy_prize_money[$a]->gain_money;
|
|
|
+ $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status', '2')->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($alraedy_prize_money); $a++) {
|
|
|
+ $data['alraedy_prize_money'] = $data['all_money'] + $alraedy_prize_money[$a]->gain_money;
|
|
|
}
|
|
|
|
|
|
if (!empty($where) && is_array($where)) {
|
|
|
@@ -296,103 +306,104 @@ class SportsNoteList extends BaseModel {
|
|
|
//$data['all_money'] = $this->where($where)->sum('money');
|
|
|
// $data['all_prize_money'] = $this->where($where)->sum('prize_money');
|
|
|
// $data['alraedy_prize_money'] = $this->where($where)->where('settle_status','2')->sum('gain_money');
|
|
|
- $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_zq_competition','st_zq_competition.id','=','money_buy_simplex.match_id')->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($all_money);$a++){
|
|
|
- $data['all_money'] = $data['all_money']+$all_money[$a]->money;
|
|
|
+ $all_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_zq_competition', 'st_zq_competition.id', '=', 'money_buy_simplex.match_id')->join('st_zq_league', 'st_zq_competition.lg_id', '=', 'st_zq_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($all_money); $a++) {
|
|
|
+ $data['all_money'] = $data['all_money'] + $all_money[$a]->money;
|
|
|
}
|
|
|
- $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($all_prize_money);$a++){
|
|
|
- $data['all_prize_money'] = $data['all_prize_money']+$all_prize_money[$a]->prize_money;
|
|
|
+ $all_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($all_prize_money); $a++) {
|
|
|
+ $data['all_prize_money'] = $data['all_prize_money'] + $all_prize_money[$a]->prize_money;
|
|
|
}
|
|
|
- $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where($where)->where('money_buy_simplex.status','1')->get();
|
|
|
- for($a=0;$a<count($alraedy_prize_money);$a++){
|
|
|
- $data['alraedy_prize_money'] = $data['alraedy_prize_money']+$alraedy_prize_money[$a]->gain_money;
|
|
|
+ $alraedy_prize_money = $this->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')->join('st_' . $type . '_league', 'st_' . $type . '_competition.lg_id', '=', 'st_' . $type . '_league.id')->select('money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status', '2')->where($where)->where('money_buy_simplex.status', '1')->get();
|
|
|
+ for ($a = 0; $a < count($alraedy_prize_money); $a++) {
|
|
|
+ $data['alraedy_prize_money'] = $data['alraedy_prize_money'] + $alraedy_prize_money[$a]->gain_money;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
- //修改赛事下的所有单式下注 3199308
|
|
|
- function updatesimplex($ssid,$code){
|
|
|
+ //修改赛事下的所有单式下注 3199308
|
|
|
+ function updatesimplex($ssid, $code)
|
|
|
+ {
|
|
|
$newapp = new \App\Models\MoneyBuyMatch();
|
|
|
- $data = $newapp->allsimplexorder($ssid,$code);
|
|
|
- if($data){
|
|
|
- for ($i=0; $i < count($data); $i++) {
|
|
|
+ $data = $newapp->allsimplexorder($ssid, $code);
|
|
|
+ if ($data) {
|
|
|
+ for ($i = 0; $i < count($data); $i++) {
|
|
|
$the = array(
|
|
|
'status' => 2,
|
|
|
'game_status' => 3,
|
|
|
- 'game_code' =>$code,
|
|
|
+ 'game_code' => $code,
|
|
|
);
|
|
|
- $res = $this->where('order_id',$data[$i]['order_id'])->update($the);
|
|
|
+ $res = $this->where('order_id', $data[$i]['order_id'])->update($the);
|
|
|
}
|
|
|
- if($res<0){
|
|
|
+ if ($res < 0) {
|
|
|
return -7012000302; //操作失败
|
|
|
}
|
|
|
return $res;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return -111;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- function info($list = 10, $page, $where = '',$type)
|
|
|
+ function info($list = 10, $page, $where = '', $type)
|
|
|
{
|
|
|
$data = $this
|
|
|
- ->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')
|
|
|
- ->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')
|
|
|
+ ->join('money_details', 'money_details.info_identity', '=', 'money_buy_simplex.info_identity')
|
|
|
+ ->join('st_' . $type . '_competition', 'st_' . $type . '_competition.id', '=', 'money_buy_simplex.match_id')
|
|
|
// ->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')
|
|
|
- ->join('st_'.$type.'_league','money_buy_simplex.lg_id','=','st_'.$type.'_league.id')
|
|
|
- ->select('money_buy_simplex.id','money_buy_simplex.account_name','money_buy_simplex.is_champion','money_buy_simplex.account_identity','money_buy_simplex.order_id','money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.status','money_buy_simplex.money_time','money_buy_simplex.settle_status','money_buy_simplex.gain_money','money_buy_simplex.game_code','money_buy_simplex.match_id','money_buy_simplex.game_status','st_'.$type.'_competition.home_team','st_'.$type.'_competition.guest_team','st_'.$type.'_competition.match_date','st_'.$type.'_competition.match_time','st_'.$type.'_competition.lg_id','st_'.$type.'_competition.status as match_status','money_details.money_cash','money_buy_simplex.batch_id','st_'.$type.'_league.name_chinese','st_'.$type.'_league.last_time')
|
|
|
+ ->join('st_' . $type . '_league', 'money_buy_simplex.lg_id', '=', 'st_' . $type . '_league.id')
|
|
|
+ ->select('money_buy_simplex.id', 'money_buy_simplex.account_name', 'money_buy_simplex.is_champion', 'money_buy_simplex.account_identity', 'money_buy_simplex.order_id', 'money_buy_simplex.money', 'money_buy_simplex.prize_money', 'money_buy_simplex.status', 'money_buy_simplex.money_time', 'money_buy_simplex.settle_status', 'money_buy_simplex.gain_money', 'money_buy_simplex.game_code', 'money_buy_simplex.match_id', 'money_buy_simplex.game_status', 'st_' . $type . '_competition.home_team', 'st_' . $type . '_competition.guest_team', 'st_' . $type . '_competition.match_date', 'st_' . $type . '_competition.match_time', 'st_' . $type . '_competition.lg_id', 'st_' . $type . '_competition.status as match_status', 'money_details.money_cash', 'money_buy_simplex.batch_id', 'st_' . $type . '_league.name_chinese', 'st_' . $type . '_league.last_time')
|
|
|
->where($where)
|
|
|
- ->orderby('money_buy_simplex.money_time','desc')
|
|
|
- ->paginate ($list);
|
|
|
+ ->orderby('money_buy_simplex.money_time', 'desc')
|
|
|
+ ->paginate($list);
|
|
|
if (!$data < 0) {
|
|
|
return -2021052003; //
|
|
|
}
|
|
|
|
|
|
//反水
|
|
|
- $water_return_money = \App\Models\Money_details::where('trade_type','7')->get();
|
|
|
+ $water_return_money = \App\Models\Money_details::where('trade_type', '7')->get();
|
|
|
|
|
|
//注单作废
|
|
|
- $invalid_money = \App\Models\Money_details::where('trade_type','3')->get();
|
|
|
+ $invalid_money = \App\Models\Money_details::where('trade_type', '3')->get();
|
|
|
|
|
|
//订单投注的玩法
|
|
|
- $content = \App\Models\MoneyBuyMatch::where('bet_type','1')->get();
|
|
|
- for($d=0;$d<count($content);$d++){
|
|
|
- if($content[$d]->result==0){
|
|
|
+ $content = \App\Models\MoneyBuyMatch::where('bet_type', '1')->get();
|
|
|
+ for ($d = 0; $d < count($content); $d++) {
|
|
|
+ if ($content[$d]->result == 0) {
|
|
|
$content[$d]->result = '未处理';
|
|
|
}
|
|
|
- if($content[$d]->result==1){
|
|
|
+ if ($content[$d]->result == 1) {
|
|
|
$content[$d]->result = '赢';
|
|
|
}
|
|
|
- if($content[$d]->result==-1){
|
|
|
+ if ($content[$d]->result == -1) {
|
|
|
$content[$d]->result = '输';
|
|
|
}
|
|
|
- if($content[$d]->result==2){
|
|
|
+ if ($content[$d]->result == 2) {
|
|
|
$content[$d]->result = '平';
|
|
|
}
|
|
|
- if($content[$d]->result==3){
|
|
|
+ if ($content[$d]->result == 3) {
|
|
|
$content[$d]->result = '赢半平半';
|
|
|
}
|
|
|
- if($content[$d]->result==4){
|
|
|
+ if ($content[$d]->result == 4) {
|
|
|
$content[$d]->result = '输半平半';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//玩法
|
|
|
- $result = \App\Models\Matchcode::where('game_code',$type)->get();
|
|
|
+ $result = \App\Models\Matchcode::where('game_code', $type)->get();
|
|
|
//$result = \App\Model\Matchcode::get();
|
|
|
|
|
|
|
|
|
- for($i=0;$i<count($data);$i++){
|
|
|
- if($data[$i]->status==1 && $data[$i]->game_status==0){
|
|
|
- $data[$i]->order_status = '投注'.'<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id='.$data[$i]->id.'\');"> 作废 </a>';
|
|
|
- }else if($data[$i]->status==1 && $data[$i]->game_status!=0){
|
|
|
+ for ($i = 0; $i < count($data); $i++) {
|
|
|
+ if ($data[$i]->status == 1 && $data[$i]->game_status == 0) {
|
|
|
+ $data[$i]->order_status = '投注' . '<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $data[$i]->id . '\');"> 作废 </a>';
|
|
|
+ } else if ($data[$i]->status == 1 && $data[$i]->game_status != 0) {
|
|
|
$data[$i]->order_status = '投注';
|
|
|
- }else if($data[$i]->status==2){
|
|
|
+ } else if ($data[$i]->status == 2) {
|
|
|
$data[$i]->order_status = '作废';
|
|
|
- }else if($data[$i]->status==3){
|
|
|
+ } else if ($data[$i]->status == 3) {
|
|
|
$data[$i]->order_status = '撤单';
|
|
|
}
|
|
|
// if($data[$i]->settle_status==1){
|
|
|
@@ -400,36 +411,36 @@ class SportsNoteList extends BaseModel {
|
|
|
// }else if($data[$i]->settle_status==2){
|
|
|
// $data[$i]->settle_status = '已结算';
|
|
|
// }
|
|
|
- if($data[$i]->game_status==0){
|
|
|
+ if ($data[$i]->game_status == 0) {
|
|
|
$data[$i]->game_status = '未处理';
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$data[$i]->game_status = '已处理';
|
|
|
}
|
|
|
|
|
|
- if($data[$i]->game_code == 'zq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'zq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'lq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'lq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'wq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'wq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
- if($data[$i]->game_code == 'bq'){
|
|
|
- $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team='.$data[$i]->match_id.'">'.$data[$i]->match_id.'</a> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
|
|
|
+ if ($data[$i]->game_code == 'bq') {
|
|
|
+ $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
|
|
|
}
|
|
|
|
|
|
$data[$i]->league = $data[$i]->name_chinese;
|
|
|
|
|
|
- if($data[$i]->is_champion == 0){
|
|
|
- $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
|
|
|
- $data[$i]->time = '开赛:'.$data[$i]->match_date.' '.$data[$i]->match_time;
|
|
|
- }else{
|
|
|
+ if ($data[$i]->is_champion == 0) {
|
|
|
+ $data[$i]->home_guest = $data[$i]->home_team . ' VS ' . $data[$i]->guest_team;
|
|
|
+ $data[$i]->time = '开赛:' . $data[$i]->match_date . ' ' . $data[$i]->match_time;
|
|
|
+ } else {
|
|
|
$data[$i]->home_guest = '冠军联赛投注';
|
|
|
- $data[$i]->time = '结束:'.$data[$i]->last_time;
|
|
|
-
|
|
|
+ $data[$i]->time = '结束:' . $data[$i]->last_time;
|
|
|
+
|
|
|
}
|
|
|
- $data[$i]->money_match_time = '下注:'.$data[$i]->money_time.$data[$i]->time;
|
|
|
+ $data[$i]->money_match_time = '下注:' . $data[$i]->money_time . $data[$i]->time;
|
|
|
|
|
|
/*
|
|
|
$data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
|
|
|
@@ -439,96 +450,96 @@ class SportsNoteList extends BaseModel {
|
|
|
*/
|
|
|
//反水
|
|
|
$data[$i]->water_return = -1;
|
|
|
- for($a=0;$a<count($water_return_money);$a++){
|
|
|
- if($data[$i]->order_id == $water_return_money[$a]->trade_id){
|
|
|
- if($data[$i]->status == 2 || $data[$i]->status == 3){
|
|
|
+ for ($a = 0; $a < count($water_return_money); $a++) {
|
|
|
+ if ($data[$i]->order_id == $water_return_money[$a]->trade_id) {
|
|
|
+ if ($data[$i]->status == 2 || $data[$i]->status == 3) {
|
|
|
$data[$i]->water_return = 0;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$data[$i]->water_return = $water_return_money[$a]->money;
|
|
|
}
|
|
|
//用户投注后账户金额
|
|
|
$data[$i]->frozen_cash = $water_return_money[$a]->money_cash;
|
|
|
}
|
|
|
}
|
|
|
- if($data[$i]->water_return == -1){
|
|
|
+ if ($data[$i]->water_return == -1) {
|
|
|
$data[$i]->water_return = 0;
|
|
|
//用户投注后账户金额
|
|
|
$data[$i]->frozen_cash = $data[$i]->money_cash;
|
|
|
}
|
|
|
//此时结果金额
|
|
|
- $data[$i]->result = $data[$i]->water_return+$data[$i]->gain_money;
|
|
|
+ $data[$i]->result = $data[$i]->water_return + $data[$i]->gain_money;
|
|
|
//用户投注前账户金额
|
|
|
- $data[$i]->available_cash = $data[$i]->money_cash+$data[$i]->money;
|
|
|
+ $data[$i]->available_cash = $data[$i]->money_cash + $data[$i]->money;
|
|
|
//投注前后账户金额
|
|
|
- $data[$i]->account_money = $data[$i]->available_cash.'<br><span>'.$data[$i]->money.'</span><br>'.$data[$i]->frozen_cash;
|
|
|
- if($data[$i]->status == 2 || $data[$i]->status == 3){
|
|
|
- for($b=0;$b<count($invalid_money);$b++){
|
|
|
- if($data[$i]->order_id == $invalid_money[$b]->trade_id){
|
|
|
+ $data[$i]->account_money = $data[$i]->available_cash . '<br><span>' . $data[$i]->money . '</span><br>' . $data[$i]->frozen_cash;
|
|
|
+ if ($data[$i]->status == 2 || $data[$i]->status == 3) {
|
|
|
+ for ($b = 0; $b < count($invalid_money); $b++) {
|
|
|
+ if ($data[$i]->order_id == $invalid_money[$b]->trade_id) {
|
|
|
$data[$i]->available_cash = $invalid_money[$b]->money_cash;
|
|
|
$data[$i]->account_money = $data[$i]->available_cash;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$data[$i]->str = 0;
|
|
|
- for($b=0;$b<count($content);$b++){
|
|
|
+ for ($b = 0; $b < count($content); $b++) {
|
|
|
$data[$i]->str1 = 0;
|
|
|
$data[$i]->team = '';
|
|
|
- if(!empty($content[$b]->odds_code)){
|
|
|
- if(!empty(stristr($content[$b]->odds_code,'home'))){
|
|
|
+ if (!empty($content[$b]->odds_code)) {
|
|
|
+ if (!empty(stristr($content[$b]->odds_code, 'home'))) {
|
|
|
$data[$i]->team = $data[$i]->home_team;
|
|
|
}
|
|
|
- if(!empty(stristr($content[$b]->odds_code,'guest'))){
|
|
|
+ if (!empty(stristr($content[$b]->odds_code, 'guest'))) {
|
|
|
$data[$i]->team = $data[$i]->guest_team;
|
|
|
}
|
|
|
- if($content[$b]->p_code == 'half_full'){
|
|
|
- $string = str_replace('home',$data[$i]->home_team,$content[$b]->odds_code);
|
|
|
- $string = str_replace('guest',$data[$i]->guest_team,$string);
|
|
|
- $string = str_replace('dogfall','和局',$string);
|
|
|
- $string = explode('_',$string);
|
|
|
- $data[$i]->team = $string['2'].'/'.$string['3'];
|
|
|
+ if ($content[$b]->p_code == 'half_full') {
|
|
|
+ $string = str_replace('home', $data[$i]->home_team, $content[$b]->odds_code);
|
|
|
+ $string = str_replace('guest', $data[$i]->guest_team, $string);
|
|
|
+ $string = str_replace('dogfall', '和局', $string);
|
|
|
+ $string = explode('_', $string);
|
|
|
+ $data[$i]->team = $string['2'] . '/' . $string['3'];
|
|
|
}
|
|
|
}
|
|
|
//处理普通赛事
|
|
|
- if($data[$i]->match_id == $content[$b]->match_id && $data[$i]->batch_id == $content[$b]->batch_id &&$data[$i]->is_champion == 0){
|
|
|
- if($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal'){
|
|
|
+ if ($data[$i]->match_id == $content[$b]->match_id && $data[$i]->batch_id == $content[$b]->batch_id && $data[$i]->is_champion == 0) {
|
|
|
+ if ($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal') {
|
|
|
$content[$b]->condition = '';
|
|
|
}
|
|
|
$data[$i]->game_status = $data[$i]->game_status;
|
|
|
//投注详情
|
|
|
- if(!empty($data[$i]->match_time)){
|
|
|
- $data[$i]->content1 = '['.$data[$i]->match_time.']';
|
|
|
+ if (!empty($data[$i]->match_time)) {
|
|
|
+ $data[$i]->content1 = '[' . $data[$i]->match_time . ']';
|
|
|
//$data[$i]->match_time = $data[$i]->match_time;
|
|
|
- }else{
|
|
|
- if(!empty($data[$i]->last_time)){
|
|
|
- $datetime = explode(' ',$data[$i]->last_time);
|
|
|
+ } else {
|
|
|
+ if (!empty($data[$i]->last_time)) {
|
|
|
+ $datetime = explode(' ', $data[$i]->last_time);
|
|
|
//$data[$i]->match_time = $datetime[1];
|
|
|
- $data[$i]->content1 = '['.$datetime[1].']';
|
|
|
+ $data[$i]->content1 = '[' . $datetime[1] . ']';
|
|
|
}
|
|
|
}
|
|
|
- for($c=0;$c<count($result);$c++){
|
|
|
- if($content[$b]->odds_code == $result[$c]->odds_code){
|
|
|
+ for ($c = 0; $c < count($result); $c++) {
|
|
|
+ if ($content[$b]->odds_code == $result[$c]->odds_code) {
|
|
|
$data[$i]->str1 = 1;
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $data[$i]->content . $result[$c]->odds_name . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $data[$i]->content . $result[$c]->odds_name . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if($data[$i]->str1 == 0){
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ if ($data[$i]->str1 == 0) {
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //处理冠军联赛玩法详情
|
|
|
- if($data[$i]->match_id == $content[$b]->lg_id && $data[$i]->batch_id == $content[$b]->batch_id &&$data[$i]->is_champion == 1){
|
|
|
+ //处理冠军联赛玩法详情
|
|
|
+ if ($data[$i]->match_id == $content[$b]->lg_id && $data[$i]->batch_id == $content[$b]->batch_id && $data[$i]->is_champion == 1) {
|
|
|
|
|
|
$content[$b]->condition = '';
|
|
|
|
|
|
- if($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal'){
|
|
|
+ if ($content[$b]->p_code == 'first_last_ball' || $content[$b]->p_code == 'half_full' || $content[$b]->p_code == 'capot' || $content[$b]->p_code == 'two_sides' || $content[$b]->p_code == 'total_goal') {
|
|
|
$content[$b]->condition = '';
|
|
|
}
|
|
|
|
|
|
@@ -560,25 +571,34 @@ class SportsNoteList extends BaseModel {
|
|
|
}
|
|
|
}
|
|
|
*/
|
|
|
- if($data[$i]->str1 == 0){
|
|
|
- if($content[$b]->result=='未处理'){
|
|
|
- $data[$i]->content = $content[$b]->home_team.'<br>'.$data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
|
|
|
- }else{
|
|
|
- $data[$i]->content = $content[$b]->home_team.'<br>'.$data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span>('.$content[$b]->matchresult.')<br>';
|
|
|
+ if ($data[$i]->str1 == 0) {
|
|
|
+ if ($content[$b]->result == '未处理') {
|
|
|
+ $data[$i]->content = $content[$b]->home_team . '<br>' . $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br>';
|
|
|
+ } else {
|
|
|
+ $data[$i]->content = $content[$b]->home_team . '<br>' . $data[$i]->content . $content[$b]->odds_code . '<br>' . $content[$b]->condition . ' ' . $data[$i]->team . '@' . $content[$b]->odds . ' ¥' . $content[$b]->bet_money . '<br><span>' . $content[$b]->result . '</span>(' . $content[$b]->matchresult . ')<br>';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$data[$i]->game_status = $data[$i]->settle_status;
|
|
|
- $data[$i]->content = $data[$i]->content1.$data[$i]->content;
|
|
|
+ $data[$i]->content = $data[$i]->content1 . $data[$i]->content;
|
|
|
}
|
|
|
return $data->toArray();
|
|
|
}
|
|
|
|
|
|
//查询单订单是否存在
|
|
|
- function onlyorder($orderid){
|
|
|
+ function onlyorder($orderid)
|
|
|
+ {
|
|
|
$order = $this->where('order_id', $orderid)->count();
|
|
|
return $order;
|
|
|
}
|
|
|
|
|
|
+ //查询单订单是否存在
|
|
|
+ function getorder($orderid)
|
|
|
+ {
|
|
|
+ $order = $this->with("matchdatas")->where('order_id', $orderid)->first();
|
|
|
+ return $order;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|