瀏覽代碼

追加推送 5/10

彭俊 6 年之前
父節點
當前提交
d2b8efde8e

+ 67 - 4
app/Http/Controllers/Admin/SportsBasketController.php

@@ -73,12 +73,75 @@ class SportsBasketController extends Controller {
 				$orwhere[] = array('st_lq_competition.guest_team', '=', $home_team);
 			}
 		}
-		if (!empty($match_date)) {
-//            $where[] = array('st_lq_competition.match_date', '=', '2019-04-13');
+//		if (!empty($match_date)) {
+////            $where[] = array('st_lq_competition.match_date', '=', '2019-04-13');
+//			$where[] = array('st_lq_competition.match_date', '=', $match_date);
+//		}
+//		if ($status != -1) {
+//			$where[] = array('st_lq_competition.status', '=', $status);
+//		}
+		if(!empty($match_date) && $status != -1){
+			if($match_date > date('Y-m-d',time())){
+				if ($status == 0) {
+					$where[] = array('st_lq_competition.match_date', '=', $match_date);
+				}
+				if ($status == 1) {
+					$where[] = array('st_lq_competition.match_date', '<', $match_date);
+					$where[] = array('st_lq_competition.match_date', '>', $match_date);
+				}
+				if ($status == 2) {
+					$where[] = array('st_lq_competition.match_date', '<', $match_date);
+					$where[] = array('st_lq_competition.match_date', '>', $match_date);
+				}
+			}
+			if($match_date == date('Y-m-d',time())){
+				if ($status == 0) {
+					$where[] = array('st_lq_competition.match_date', '=', $match_date);
+					$where[] = array('st_lq_competition.match_time', '>', date('H:i:s',time()));
+				}
+				if ($status == 1) {
+					$where[] = array('st_lq_competition.match_date', '=', $match_date);
+					$where[] = array('st_lq_competition.match_time', '<', date('H:i:s',time()));
+					$where[] = array('st_lq_competition.match_time', '>', date('H:i:s',time()-5400));
+				}
+				if ($status == 2) {
+					$where[] = array('st_lq_competition.match_date', '=', $match_date);
+					$where[] = array('st_lq_competition.match_time', '<', date('H:i:s',time()-5400));
+				}
+			}
+			if($match_date < date('Y-m-d',time())){
+				if ($status == 0) {
+					$where[] = array('st_lq_competition.match_date', '<', $match_date);
+					$where[] = array('st_lq_competition.match_date', '>', $match_date);
+				}
+				if ($status == 1) {
+					$where[] = array('st_lq_competition.match_date', '<', $match_date);
+					$where[] = array('st_lq_competition.match_date', '>', $match_date);
+				}
+				if ($status == 2) {
+					$where[] = array('st_lq_competition.match_date', '=', $match_date);
+				}
+			}
+		}
+		if(!empty($match_date) && $status == -1){
 			$where[] = array('st_lq_competition.match_date', '=', $match_date);
 		}
-		if ($status != -1) {
-			$where[] = array('st_lq_competition.status', '=', $status);
+		if(empty($match_date) && $status != -1){
+			if ($status == 0) {
+				$where[] = array('st_lq_competition.match_date', '=', date('Y-m-d',time()));
+				$where[] = array('st_lq_competition.match_time', '>', date('H:i:s',time()));
+				$orwhere[] = array('st_lq_competition.match_date', '>', date('Y-m-d',time()));
+			}
+			if ($status == 1) {
+				$where[] = array('st_lq_competition.match_date', '=', date('Y-m-d',time()));
+				$where[] = array('st_lq_competition.match_time', '<', date('H:i:s',time()));
+				$where[] = array('st_lq_competition.match_time', '>', date('H:i:s',time()-2400));
+			}
+			if ($status == 2) {
+				$where[] = array('st_lq_competition.match_date', '=', date('Y-m-d',time()));
+				$where[] = array('st_lq_competition.match_time', '<', date('H:i:s',time()-2400));
+				$orwhere[] = array('st_lq_competition.match_date', '<', date('Y-m-d',time()));
+			}
 		}
 		$newapp = new \App\Models\SportsBasket();
 		$data = $newapp->getinfo($list, $page, $where,$orwhere);

+ 68 - 4
app/Http/Controllers/Admin/SportsSoccerController.php

@@ -73,13 +73,77 @@ class SportsSoccerController extends Controller {
                 $orwhere[] = array('st_zq_competition.guest_team', '=', $home_team);
             }
         }
-        if (!empty($match_date)) {
-//            $where[] = array('st_zq_competition.match_date', '=', '2019-04-13');
+//        if (!empty($match_date)) {
+////            $where[] = array('st_zq_competition.match_date', '=', '2019-04-13');
+//            $where[] = array('st_zq_competition.match_date', '=', $match_date);
+//        }
+//        if ($status != -1) {
+//            $where[] = array('st_zq_competition.status', '=', $status);
+//        }
+        if(!empty($match_date) && $status != -1){
+            if($match_date > date('Y-m-d',time())){
+                if ($status == 0) {
+                    $where[] = array('st_zq_competition.match_date', '=', $match_date);
+                }
+                if ($status == 1) {
+                    $where[] = array('st_zq_competition.match_date', '<', $match_date);
+                    $where[] = array('st_zq_competition.match_date', '>', $match_date);
+                }
+                if ($status == 2) {
+                    $where[] = array('st_zq_competition.match_date', '<', $match_date);
+                    $where[] = array('st_zq_competition.match_date', '>', $match_date);
+                }
+            }
+            if($match_date == date('Y-m-d',time())){
+                if ($status == 0) {
+                    $where[] = array('st_zq_competition.match_date', '=', $match_date);
+                    $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()));
+                }
+                if ($status == 1) {
+                    $where[] = array('st_zq_competition.match_date', '=', $match_date);
+                    $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()));
+                    $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()-5400));
+                }
+                if ($status == 2) {
+                    $where[] = array('st_zq_competition.match_date', '=', $match_date);
+                    $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()-5400));
+                }
+            }
+            if($match_date < date('Y-m-d',time())){
+                if ($status == 0) {
+                    $where[] = array('st_zq_competition.match_date', '<', $match_date);
+                    $where[] = array('st_zq_competition.match_date', '>', $match_date);
+                }
+                if ($status == 1) {
+                    $where[] = array('st_zq_competition.match_date', '<', $match_date);
+                    $where[] = array('st_zq_competition.match_date', '>', $match_date);
+                }
+                if ($status == 2) {
+                    $where[] = array('st_zq_competition.match_date', '=', $match_date);
+                }
+            }
+        }
+        if(!empty($match_date) && $status == -1){
             $where[] = array('st_zq_competition.match_date', '=', $match_date);
         }
-        if ($status != -1) {
-            $where[] = array('st_zq_competition.status', '=', $status);
+        if(empty($match_date) && $status != -1){
+            if ($status == 0) {
+                $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
+                $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()));
+                $orwhere[] = array('st_zq_competition.match_date', '>', date('Y-m-d',time()));
+            }
+            if ($status == 1) {
+                $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
+                $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()));
+                $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()-5400));
+            }
+            if ($status == 2) {
+                $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
+                $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()-5400));
+                $orwhere[] = array('st_zq_competition.match_date', '<', date('Y-m-d',time()));
+            }
         }
+
         $newapp = new \App\Models\SportsSoccer();
         $data = $newapp->getinfo($list, $page, $where,$orwhere);
         return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);

+ 1 - 1
app/Lib/Settlement/SettlementOrder.php

@@ -42,7 +42,7 @@ class SettlementOrder extends SettlementBase
               DB::beginTransaction ();
               foreach ($order_ids as $order_id){
                   $this->BuyDatasMainModel = $this->orderTypeGet($order_id,$bettype);
-                  if ( $this->BuyDatasMainModel->settle_status==2 ){  throw new  \Exception('此订单已经结算过了,不能重复结算! '.$order_id ); }
+                  if ( $this->BuyDatasMainModel->settle_status==2 ){  continue ;  }
                   if ($this->orderType==1){
                       $this->SingOrder($order_id);
                   }else{

+ 18 - 18
app/Models/SportsSoccer.php

@@ -32,24 +32,24 @@ class SportsSoccer extends BaseModel {
             return -2021052003; //
         }
         for($i=0;$i<count($data);$i++){
-//            if($data[$i]->match_date < date('Y-m-d',time())){
-//                $data[$i]->status = '2';
-//                //$this->where('id', $data[$i]->id)->update(['status' => 2]);
-//            }else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time)+5400 <= strtotime(date('H:i:s',time()))){
-//                $data[$i]->status = '2';
-//                //$this->where('id', $data[$i]->id)->update(['status' => 2]);
-//            }
-//            else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time) < strtotime(date('H:i:s',time())) && strtotime(date('H:i:s',time())) < strtotime($data[$i]->match_time)+5400){
-//                $data[$i]->status = '1';
-//                //$this->where('id', $data[$i]->id)->update(['status' => 1]);
-//            }else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time) > strtotime(date('H:i:s',time()))){
-//                $data[$i]->status = '0';
-//                //$this->where('id', $data[$i]->id)->update(['status' => 0]);
-//            }
-//            else if($data[$i]->match_date > date('Y-m-d',time())){
-//                $data[$i]->status = '0';
-//                //$this->where('id', $data[$i]->id)->update(['status' => 0]);
-//            }
+            if($data[$i]->match_date < date('Y-m-d',time())){
+                $data[$i]->status = '2';
+                //$this->where('id', $data[$i]->id)->update(['status' => 2]);
+            }else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time)+5400 <= strtotime(date('H:i:s',time()))){
+                $data[$i]->status = '2';
+                //$this->where('id', $data[$i]->id)->update(['status' => 2]);
+            }
+            else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time) < strtotime(date('H:i:s',time())) && strtotime(date('H:i:s',time())) < strtotime($data[$i]->match_time)+5400){
+                $data[$i]->status = '1';
+                //$this->where('id', $data[$i]->id)->update(['status' => 1]);
+            }else if($data[$i]->match_date == date('Y-m-d',time()) && strtotime($data[$i]->match_time) > strtotime(date('H:i:s',time()))){
+                $data[$i]->status = '0';
+                //$this->where('id', $data[$i]->id)->update(['status' => 0]);
+            }
+            else if($data[$i]->match_date > date('Y-m-d',time())){
+                $data[$i]->status = '0';
+                //$this->where('id', $data[$i]->id)->update(['status' => 0]);
+            }
 
             if($data[$i]->status==0){
                 $data[$i]->status = '未开始';