Browse Source

异常处理

彭俊 6 years ago
parent
commit
77e386c543

+ 13 - 15
app/Http/Controllers/Admin/MatchRuleController.php

@@ -20,7 +20,7 @@ class MatchRuleController extends Controller
 {
 
     /**
-     * 活动公告
+     * 赛事规则
      */
     function Index(Req $req)
     {
@@ -31,18 +31,17 @@ class MatchRuleController extends Controller
         $dt->setDataSource('/admin/MatchRule/getMatchRule');
         $dt->setLang('matchRule');
         $dt->addColsFields('id', array('width' => 60));
-        // $dt->addColsFields('sort', array('width' => 120));
         $dt->addColsFields('modular_name',array('sort' => false, 'width' => 80));
         $dt->addColsFields('group_name', array('templet' => '#group_name', 'sort' => false, 'width' => 120));
-        $dt->addColsFields('atime',array('width' => 160));
-        $dt->addColsFields('author',array('width' => 80));
+        $dt->addColsFields('atime',array('width' => 120));
+        $dt->addColsFields('author',array('width' => 120));
         $dt->addColsFields('status', array('templet' => '#closeTool', 'sort' => false, 'width' => 80));
         $dt->enableCheckBox();
         $arr[] = 'view';
         if (checkRriv('/admin/MatchRule/Edit')) {
             $arr[] = 'edit';
         }
-        // $dt->setToolBar($arr, array('width' => 80));
+        $dt->setToolBar($arr, array('width' => 150));
 
         return view('admin.matchRule/arictle', $dt->render($request));
     }
@@ -53,21 +52,20 @@ class MatchRuleController extends Controller
     function getMatchRule(){
         $limit = Request::has('limit') ? Request::get('limit') : 10;
 
-		$group_name = Request::has('group_name') ? Request::get('group_name') : '';
-		$group_id = Request::has('group_id') ? Request::get('group_id') : '';
-
+		$modular_name = Request::has('title') ? Request::get('title') : '';
+        $group_id = Request::has('type') ? Request::get('type') : '';
 
 		$where = array();
-		if (!empty($group_name)) {
-			$where[] = array('group_name', 'like', '%' . $group_name . '%');
+		if (!empty($modular_name)) {
+			$where[] = array('modular_name', 'like', '%' . $modular_name . '%');
 		}
 		if (!empty($group_id)) {
 			$where[] = array('group_id', '=', $group_id);
 		}
 	
 		$db = new matchRuleModel();
-        $data = $db->getList($limit, $where);
-	
+        $data = $db->getList($limit, $where);	
+
 		return \App\Lib\DataTable\DataTable::init()->toJson($data);
     }
 
@@ -119,13 +117,13 @@ class MatchRuleController extends Controller
             if (!$data) {
                 return responseToJson($data);
             }
-            $select = $data["type"];
-            $child_id = $data["child_id"];
+            $select = $data["group_id"];
+            // $child_id = $data["child_id"];
 
             return view('admin.matchRule/editMatchRule', ['data' => $data]);
 
         } else {
-            $data['child_id'] = $req->child_id;
+            // $data['child_id'] = $req->child_id;
             $data['title'] = $req->input('title');
             // $data['author'] = $req->input('author');
             $data['sort'] = $req->input('sort');

+ 1 - 1
app/Http/Model/St_match_rule.php

@@ -19,7 +19,7 @@ class St_match_rule extends Model
      * 获取赛事规则数据
      */
     function getList($limit = 0, $where = []){
-        return  $this->where($where)
+        return  $this->select('id','group_id','group_name','author','atime','utime','status','modular_name')->where($where)
         ->limit($limit)
         ->get()
         ->toArray();

+ 1 - 1
resources/views/admin/matchRule/arictle.blade.php

@@ -38,7 +38,7 @@
                             </select> -->
 
                             <select name="type" id="type"  lay-verify="" autocomplete="off" eventType="event-query">
-                                <option value="" selected>{{ trans('matchRule.select_menutype') }}</option>
+                                <option value="0" selected>{{ trans('matchRule.select_menutype') }}</option>
                                 <option value="1" @if (isset($data['type']) && $data['type']==1 )  selected  @endif>一般体育说明</option>
                                 <option value="2" @if (isset($data['type']) && $data['type']==2 )  selected  @endif>冠军</option>
                                 <option value="3" @if (isset($data['type']) && $data['type']==3 )  selected  @endif>连串过关/复式过关</option>

+ 9 - 9
resources/views/admin/matchRule/editMatchRule.blade.php

@@ -17,15 +17,15 @@
                 <div class="layui-input-block">
                     <select name="type" id="testSelect" class="Selects" lay-filter="testSelect">
                         <option value="" selected>请选择</option>
-                        <option value="1" @if (isset($data['type']) && $data['type']==1 )  selected  @endif>一般体育说明</option>
-                        <option value="2" @if (isset($data['type']) && $data['type']==2 )  selected  @endif>冠军</option>
-                        <option value="3" @if (isset($data['type']) && $data['type']==3 )  selected  @endif>连串过关/复式过关</option>
-                        <option value="4" @if (isset($data['type']) && $data['type']==11 )  selected  @endif>独赢及位置</option>
-                        <option value="5" @if (isset($data['type']) && $data['type']==10 )  selected  @endif>提前结算</option>
-                        <option value="11" @if (isset($data['type']) && $data['type']==20 )  selected  @endif>足球</option>
-                        <option value="12" @if (isset($data['type']) && $data['type']==20 )  selected  @endif>篮球</option>
-                        <option value="13" @if (isset($data['type']) && $data['type']==20 )  selected  @endif>网球</option>
-                        <option value="14" @if (isset($data['type']) && $data['type']==20 )  selected  @endif>棒球</option>
+                        <option value="1" @if (isset($data['group_id']) && $data['group_id']==1 )  selected  @endif>一般体育说明</option>
+                        <option value="2" @if (isset($data['group_id']) && $data['group_id']==2 )  selected  @endif>冠军</option>
+                        <option value="3" @if (isset($data['group_id']) && $data['group_id']==3 )  selected  @endif>连串过关/复式过关</option>
+                        <option value="4" @if (isset($data['group_id']) && $data['group_id']==4 )  selected  @endif>独赢及位置</option>
+                        <option value="5" @if (isset($data['group_id']) && $data['group_id']==5 )  selected  @endif>提前结算</option>
+                        <option value="11" @if (isset($data['group_id']) && $data['group_id']==11 )  selected  @endif>足球</option>
+                        <option value="12" @if (isset($data['group_id']) && $data['group_id']==12 )  selected  @endif>篮球</option>
+                        <option value="13" @if (isset($data['group_id']) && $data['group_id']==13 )  selected  @endif>网球</option>
+                        <option value="14" @if (isset($data['group_id']) && $data['group_id']==14 )  selected  @endif>棒球</option>
                     </select>
                 </div>
             </div>