|
|
@@ -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');
|