Explorar el Código

追加赛事规则编辑

彭俊 hace 6 años
padre
commit
d4a63fff0e

+ 224 - 0
app/Http/Controllers/Admin/MatchRuleController.php

@@ -0,0 +1,224 @@
+<?php
+/**
+ * 系统设置
+ */
+
+namespace App\Http\Controllers\Admin;
+
+use App\Http\Controllers\Controller;
+use App\Models\ArticleType;
+use Illuminate\Http\Request as Req;
+use Request;
+use App\Http\Model\St_match_rule as matchRuleModel;
+use App\Http\Model\St_match_rule_group as matchRuleGroupModel;
+
+
+/**
+ *
+ */
+class MatchRuleController extends Controller
+{
+
+    /**
+     * 活动公告
+     */
+    function Index(Req $req)
+    {
+        $request['title'] = isset($req->title) ? trim($req->title) : null;
+        $request['type'] = isset($req->type) ? trim($req->type) : null;
+
+        $dt = \App\Lib\DataTable\DataTable::init();
+        $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('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));
+
+        return view('admin.matchRule/arictle', $dt->render($request));
+    }
+
+    /**
+     * 获取赛事规则数据
+     */
+    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') : '';
+
+
+		$where = array();
+		if (!empty($group_name)) {
+			$where[] = array('group_name', 'like', '%' . $group_name . '%');
+		}
+		if (!empty($group_id)) {
+			$where[] = array('group_id', '=', $group_id);
+		}
+	
+		$db = new matchRuleModel();
+        $data = $db->getList($limit, $where);
+	
+		return \App\Lib\DataTable\DataTable::init()->toJson($data);
+    }
+
+    /**
+     * 发布赛事规则
+     */
+    function addMatchRule(Req $req)
+    {
+        if (!$req->isMethod('post')) {
+            return view('admin.matchRule/editMatchRule', ['select' => 0, "child_id" => 0]);
+        } else {
+            if(matchRuleModel::where('group_id', $req->type)->first()){
+                return responseToJson(-20001);
+            }
+            $data['modular_name'] = $req->input('title');
+            $data['group_id'] = $req->type;
+            $data['group_name'] = matchRuleGroupModel::find($data['group_id'])->group_name;
+            $data['content'] = $req->desc;
+            $log = array(
+                session('adminInfo.admin_name'),
+                $data['modular_name']
+            );
+
+            $data['atime'] = date('Y-m-d H:i:s');
+            $data['utime'] = date('Y-m-d H:i:s');
+            $data['author'] = session('adminInfo.admin_name');
+            $data['status'] = 1;
+            $db = new matchRuleModel();
+            $res = $db->addMatchRule($data);
+            OperationLog(session('adminInfo.admin_id'), 'add_match_rule', $log);
+            return responseToJson(1);
+        }
+    }
+
+    /**
+     * 编辑
+     */
+    function Edit(Req $req)
+    {
+        $id = $req->id;
+        if (intval($id) < 1) {
+            abort(404);
+        }
+
+        $db = new matchRuleModel;
+        if (!$req->isMethod('post')) {
+            $data = $db->getDmsg($id);
+
+            if (!$data) {
+                return responseToJson($data);
+            }
+            $select = $data["type"];
+            $child_id = $data["child_id"];
+
+            return view('admin.matchRule/editMatchRule', ['data' => $data]);
+
+        } else {
+            $data['child_id'] = $req->child_id;
+            $data['title'] = $req->input('title');
+            // $data['author'] = $req->input('author');
+            $data['sort'] = $req->input('sort');
+            $data['type'] = $req->input('type');
+            $data['img'] = $req->input('img');
+            $data['typebind'] = $req->input('typebind');
+            $data['mobilecontent'] = $req->mobilecontent;
+            $data['mobileimg'] = $req->input('mobileimg');
+            $data['content'] = $req->desc;
+            $res = $db->updateMsg($data, $id);
+            $log = array(
+                session('adminInfo.admin_name'),
+                $data['title']
+            );
+            OperationLog(session('adminInfo.admin_id'), 'edit_game', $log);
+            return responseToJson($res);
+        }
+    }
+
+    /**
+     * 禁用
+     */
+    function activeClose(Req $req)
+    {
+        $status = $req->has('status') ? $req->get('status') : '';
+        $id = $req->has('id') ? $req->get('id') : '';
+
+
+        if (empty($id)) {
+            return responseToJson(-5030002031);
+        }
+        if ($status < 0) {
+            return responseToJson(-5030002032);
+        }
+
+        $db = new matchRuleModel();
+
+        $data = array(
+            'status' => $status,
+        );
+        if ($status) {
+            $data['status'] = 1;
+        } else {
+            $data['status'] = 0;
+        }
+        $res = $db->closeGame(["id" => intval($id)], $data);
+        return responseToJson($res);
+    }
+
+
+    /**
+     * 查看
+     */
+    function view(Req $req)
+    {
+        return $this->Edit($req);
+    }
+
+   
+   
+
+    /**
+     * 批量删除
+     * [delete description]
+     * @return [type] [description]
+     */
+    function delete(Req $req)
+    {
+        $id = $req->input('id');
+        if (empty($id)) {
+            return responseToJson(-2001);
+        }
+        $ids = explode(',', $id);
+        if (!is_array($ids) && intval($ids) < 0) {
+            return responseToJson(-2002);
+        }
+        if (is_array($ids) && count($ids) > 0) {
+            foreach ($ids as $k => $v) {
+                if (intval($v) < 1) {
+                    unset($ids[$k]);
+                }
+            }
+        }
+        $rows = matchRuleModel::whereIn('id', $ids)->delete();
+        if (!$rows) {
+            return responseToJson(-2003);
+        }
+        return responseToJson(1);
+    }
+
+   
+
+    
+}
+
+?>

+ 7 - 2
app/Http/Controllers/Admin/SoccerStringNoteListController.php

@@ -92,10 +92,15 @@ class SoccerStringNoteListController extends Controller
             $where[] = array('money_buy_str.order_id', $order_id);
         }
 
+        $ids = array();
         if(!empty($match_id)){
             $allcs = new \App\Models\MoneyBuyMatch();
             $csorder = $allcs->allstrorder($match_id);
-            $where[] = array('money_buy_str.order_id', $csorder[0]['order_id']);
+            if(!empty($csorder)){
+                for($i=0;$i<count($csorder);$i++){
+                    $ids[] = $csorder[$i]['order_id'];
+                }
+            }
         }
             
         if ($status != -1) {
@@ -105,7 +110,7 @@ class SoccerStringNoteListController extends Controller
             $where[] = array('money_buy_str.status', '=', $order_status);
         }
         $newapp = new \App\Models\MoneyBuyStr();
-        $data = $newapp->getinfo($list, $page, $where);
+        $data = $newapp->getinfo($list, $page, $where,$ids);
 
         return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total'], 0, $where);
     }

+ 55 - 0
app/Http/Model/St_match_rule.php

@@ -0,0 +1,55 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+use App\Http\Response\Response;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 赛事规则model
+ */
+class St_match_rule extends Model
+{
+
+    protected $table = 'st_match_rule';
+    public $timestamps = false;
+
+    /**
+     * 获取赛事规则数据
+     */
+    function getList($limit = 0, $where = []){
+        return  $this->where($where)
+        ->limit($limit)
+        ->get()
+        ->toArray();
+
+    }
+
+    /**
+     * 添加赛事规则
+     */
+    function addMatchRule($data){
+        $res=$this->insert($data);
+        if(!$res){
+            return -6030001222;
+        }
+    }
+
+    /**
+     * 获取当前id规则
+     */
+    function getDmsg($id=0) {
+		$data = $this->find($id);
+		if (!$data) {
+			return -4010010122; //没有数据
+		}
+		return $data->toArray();
+    }
+
+    //禁用操作
+    public function closeGame($where,$data){
+        return $this->where($where)->update($data);
+    }
+   
+}

+ 20 - 0
app/Http/Model/St_match_rule_group.php

@@ -0,0 +1,20 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+use App\Http\Response\Response;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 赛事规则组model
+ */
+class St_match_rule_group extends Model
+{
+
+    protected $table = 'st_match_rule_group';
+    public $timestamps = false;
+
+
+   
+}

+ 1 - 1
app/Http/Response/Response.php

@@ -112,7 +112,7 @@ class Response
         self::DEL_ODDS_ERR =>'删除无效赔率失败',
 
         //===写预植赛果失败===
-        self::SET_MATCH_ERR =>'写预赛果失败',
+        self::SET_MATCH_ERR =>'写预赛果失败',
 
         //===写赛果失败===
         self::SET_MATCH_R_ERR =>'写赛果失败',

+ 1 - 1
app/Models/MoneyBuyMatch.php

@@ -45,7 +45,7 @@ class MoneyBuyMatch extends Model
         $where = array();
         $where[] = array('money_buy_match.match_id', '=', $ssid);
         $where[] = array('money_buy_match.bet_type', '=', 2);
-        $data = $this->join('money_buy_str', 'money_buy_match.batch_id', '=', 'money_buy_str.batch_id')->select('money_buy_str.order_id')->where($where)->get()->toArray();
+        $data = $this->join('money_buy_str', 'money_buy_match.batch_id', '=', 'money_buy_str.batch_id')->select('money_buy_str.order_id')->where($where)->distinct('money_buy_match.batch_id')->get()->toArray();
         return $data;
     }
 

+ 3 - 1
app/Models/MoneyBuyStr.php

@@ -11,19 +11,21 @@ class MoneyBuyStr extends BaseModel {
     protected $table = "money_buy_str";
     public $timestamps = false;
 
-    function getinfo($list = 10, $page, $where = '')
+    function getinfo($list = 10, $page, $where = '',$ids)
     {
         if (is_array ($where) && count ($where) > 0) {
             $data = $this
                 ->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
                 ->select('money_buy_str.id','money_buy_str.account_name','money_buy_str.account_identity','money_buy_str.order_id','money_buy_str.str_type','money_buy_str.money','money_buy_str.prize_money','money_buy_str.status','money_buy_str.money_time','money_buy_str.settle_status','money_buy_str.game_status','money_buy_str.gain_money','money_details.money_cash','money_buy_str.batch_id')
                 ->where($where)
+                ->wherein('money_buy_str.order_id',$ids)
                 ->orderby('money_buy_str.money_time','desc')
                 ->paginate ($list);
         } else {
             $data = $this
                 ->join('money_details','money_details.info_identity','=','money_buy_str.info_identity')
                 ->select('money_buy_str.id','money_buy_str.account_name','money_buy_str.account_identity','money_buy_str.order_id','money_buy_str.str_type','money_buy_str.money','money_buy_str.prize_money','money_buy_str.status','money_buy_str.money_time','money_buy_str.settle_status','money_buy_str.game_status','money_buy_str.gain_money','money_details.money_cash','money_buy_str.batch_id')
+                ->wherein('money_buy_str.order_id',$ids)
                 ->orderby('money_buy_str.money_time','desc')
                 ->paginate ($list);
         }

+ 6 - 1
resources/lang/zh-cn/error.php

@@ -416,5 +416,10 @@ return [
     '-500145'=>'增加用户账户资金失败',
     '-500146'=>'扣减用户账户资金失败',
     '-500147'=>'更新资金流水失败',
-    '999'=>'成功'
+    '999'=>'成功',
+
+    /**
+     * 赛事规则管理
+     */
+    '-20001' =>'该组已有相关文档,不能添加',
 ];

+ 52 - 0
resources/lang/zh-cn/matchRule.php

@@ -0,0 +1,52 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: admin
+ * Date: 2017/12/6
+ * Time: 9:18
+ */
+return array(
+	//玩法
+	'id' => 'ID',
+	//公告
+	'group_name' => '所属组',
+	'content' => '内容',
+	'atime' => '发布时间',
+  'type' => '类型',
+  'author' => '作者',
+  'u_time' => '更新时间',
+  'modular_name'  =>'所属模块',
+  'select_menutype' => '请选择类型',
+
+
+	'infocontent' => '设置内容',
+	'status' => '状态',
+	'add_startime' => '发布时间起',
+	'add_endtime' => '发布时间止',
+	'select_status' => '请选择状态',
+    'add_time'=>'添加时间',
+    'toname'=>'接收者',
+    'formname'=>'发送者',
+    'message_type'=>'信息类型',
+  //  'status'=>'查看状态',
+    'chakan'=>'操作',
+    'banner_link'=>'广告超链接',
+    'banner_name'=>'图片名称',
+    'banner_name'=>'图片名称',
+    'banner_url'=>'图片地址',
+    'advert_id'=>'类型',
+    'add_time'=>'添加时间',
+    'add_type'=>'新用户是否接收',
+    'sort'=>'排序',
+    // 'group_name'=>'接收用户组',
+    'message_status'=>array(
+      '1'=>'接收',
+      '2'=>'不接收',
+    ),
+    'is_show' => '首页是否弹出',
+    'show' => array(
+        '1' => '显示',
+        '0' => '不显示'
+    ),
+    'typebind' => '绑定参数'
+);

+ 184 - 0
resources/views/admin/matchRule/arictle.blade.php

@@ -0,0 +1,184 @@
+@extends('vip.layouts')
+@section('content')
+    <style>
+        .layui-laydate-range {
+            width: auto;
+        }
+    </style>
+    <script type="text/html" id="title">
+        @{{d.title}}
+
+    </script>
+    <!---注单管理-->
+    <div class="layui-row">
+
+        <!-- <div class="layui-col-xs12 layui-col-sm2 layui-col-md2">
+            <ul id="tree" class="tree-table-tree-box"></ul>
+        </div>-->
+        <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
+
+            <form class="layui-form rewrite" id="layui-form" eventType="eventForm" action="">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">{{ trans('matchRule.modular_name') }}</label>
+                        <div class="layui-input-inline">
+                            <input type="text" name="title" id="title" eventType="event-query" value="体育"
+                                   lay-verify="" autocomplete="off"
+                                   class="layui-input">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">{{ trans('matchRule.group_name') }}</label>
+                        <div class="layui-input-inline" id="layui-sel">
+                            <!-- <select name="type" id="type" lay-verify="" autocomplete="off" eventType="event-query">
+                                <option value="">{{ trans('menu.select_menutype') }}</option>
+                                @foreach(trans('status.article.type') as $k=>$v):
+                                <option value="{{$k}}" @if($k==$type) selected @endif>{{$v}}</option>
+                                @endforeach
+                            </select> -->
+
+                            <select name="type" id="type"  lay-verify="" autocomplete="off" eventType="event-query">
+                                <option value="" 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>
+                                <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>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <!--<a class="layui-btn layui-btn-sm lay-btn-diy" id="sub"  eventType="event-query-submit"
+                           style="opacity: 1; pointer-events: auto;">提交</a>-->
+                        <a class="layui-btn layui-btn-sm lay-btn-diy" id="sub"
+                           style="opacity: 1; pointer-events: auto;">提交</a>
+                        <a class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload"
+                           style="opacity: 1; pointer-events: auto;">重置</a>
+                        <!-- <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload"
+                        style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a> -->
+                        <a class="layui-btn layui-btn-sm layui-btn-green " href="javascript:window.location.reload()"
+                           data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
+
+                    </div>
+                    @if(checkRriv('/admin/MatchRule/addMatchRule'))
+                        <div class="layui-inline">
+                            <a href="/admin/MatchRule/addMatchRule" class="layui-btn layui-btn-sm  ">添加</a>
+
+                        </div>@endif
+                    @if(checkRriv('/admin/MatchRule/delete'))
+                        <div class="layui-inline"><a href="javascript:delWin('/admin/MatchRule/delete?id=');"
+                                                     class="layui-btn layui-btn-sm  layui-btn-danger">删除</a></div>@endif
+                </div>
+            </form>
+        </div>
+        <script type="text/html" id="closeTool">
+            <!-- 这里的 checked 的状态只是演示 -->
+            @if(checkRriv('/admin/BankInfo/GameClose'))<input type="checkbox" name="status" value="@{{d.id}}"
+                                                              lay-skin="switch" lay-text="开启|禁用" lay-filter="openStatus"
+                                                              @{{ d.status== '1' ? 'checked' : '' }}>@endif
+        </script>
+
+        @push('dataTableJS')
+            //                var active = {
+            //                reload: function(){
+            //                //执行重载
+            //                table.reload('{{ $dataId }}', {
+            //            page: {
+            //                curr: 1 //重新从第 1 页开始
+            //                }
+            //                ,where: {
+            ///                title:$("#title").val(),
+            //                type:$('#type').val(),
+            //                add_startime:$('#add_startime').val(),
+            //                add_endtime:$('#add_endtime').val(),
+            //                }
+            //                });
+            //                }
+            //                };
+            //                $('.lay-btn-diy').on('click', function(){
+            //                var type = $(this).data('type');
+            //                active[type] ? active[type].call(this) : '';
+            //                });
+
+            $('#sub').on('click', function(){
+            var title = $('#title').val();
+            var type = $('#type').val();
+            $('#layui-form').submit();
+            return ;
+
+
+            if((title == '' || title == null) && (type == '' || type == null) )
+            {
+            layer.msg('手动搜索时,类型不能为空!', {icon: 6});
+
+            // layer.tips('手动搜索时,类型不能为空!','#type',{
+            //     tips: 4
+            // });
+            }
+            else
+            {
+            $('#layui-form').submit();
+            }
+            });
+
+            //重置表单
+            $('.reset').on('click',function(){
+            $('input').val('');
+            $('#type').val('');
+            // var type = $(this).data('type');
+            // active[type] ? active[type].call(this) : '';
+            });
+
+            //刷新表单
+            //  $('.set').on('click',function(){
+            //   var type = $(this).data('type');
+            //    active[type] ? active[type].call(this) : '';
+            //    });
+            form.on('switch(openStatus)', function(obj){
+            var status = 0;
+            if(obj.elem.checked==true){
+            status =1;
+            }
+
+            setcolumn('/admin/MatchRule/activeClose',this.name,status,this.value,obj);
+            <!-- console.log(obj); -->
+            //layer.tips(msg, obj.othis);
+            });
+
+            function setcolumn(url,column,value,id,obj){
+
+            $.ajax({
+            url: url+'?'+column+'='+value+'&id='+id,
+            dataType: 'json',
+            type: 'get',
+            success:function(data){
+            layer.msg(data.msg);
+            if(data.status!=1){
+            if(value==1){
+            obj.othis[0].setAttribute("class", "layui-unselect layui-form-switch");
+            obj.othis[0].innerHTML='<em>开启</em><i></i>';
+            }else{
+            obj.othis[0].setAttribute("class",'layui-unselect layui-form-switch layui-form-onswitch');
+            obj.othis[0].innerHTML='<em>禁用</em><i></i>';
+            }
+            }
+            },
+            error:function(){
+            }
+
+            });
+            }
+
+
+        @endpush
+
+        @include('vip.datatable')
+        <link rel="stylesheet" href="{{ asset('/css/untablelist.css') }}"/>
+    </div>
+    </div>
+
+@endsection

+ 154 - 0
resources/views/admin/matchRule/editMatchRule.blade.php

@@ -0,0 +1,154 @@
+@extends('vip.layouts254js')
+@section('content')
+    <link href={{ asset("baidu/themes/default/css/umeditor.css") }} type="text/css" rel="stylesheet">
+    <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post"
+          eventType=eventAjaxForm>
+        {!! csrf_field() !!}
+        <div class="layui-form-item">
+            <label class="layui-form-label">所属模块</label>
+            <div class="layui-input-block">
+                <input type="text" name="title" required lay-verify="required" autocomplete="off" class="layui-input"
+                       value="体育">
+            </div>
+        </div>
+        @if(isset($select))
+            <div class="layui-form-item">
+                <label class="layui-form-label">所属类别</label>
+                <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>
+                    </select>
+                </div>
+            </div>
+        @endif
+
+        <div class="layui-form-item">
+            <label class="layui-form-label">具体内容</label>
+            <div class="layui-input-block">
+                <textarea name="desc" id="myEditor"
+                          style="width:1000px;height:240px;">{{isset($data['content'])?$data['content']:''}}</textarea>
+            </div>
+        </div>
+      
+        @if(isset($list))
+            <div class="layui-form-item">
+                <label class="layui-form-label">作者</label>
+                <div class="layui-input-block">
+                    <input type="text" name="author" required lay-verify="required" autocomplete="off"
+                           class="layui-input" value="{{isset($data['author'])?$data['author']:''}}">
+                </div>
+            </div>
+        @endif
+
+        <div class="layui-form-item">
+            <div class="layui-input-block">
+                @if(checkRriv('/admin/Notice/view'))
+                    <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>@endif
+                <button type="reset" class="layui-btn layui-btn-normal">重置</button>
+            </div>
+        </div>
+    </form>
+    <script type="text/javascript" src={{ asset("baidu/third-party/jquery.min.js") }}></script>
+    <script type="text/javascript" charset="utf-8" src={{ asset("baidu/umeditor.config.js") }}></script>
+    <script type="text/javascript" charset="utf-8" src={{ asset("baidu/umeditor.min.js") }}></script>
+    <script type="text/javascript" src={{ asset("baidu/lang/zh-cn/zh-cn.js") }}></script>
+    <script>
+        //Demo
+        layui.use(['form', 'layedit', 'laydate', 'upload'], function () {
+            var form = layui.form
+                , layer = layui.layer
+                , layedit = layui.layedit
+                , laydate = layui.laydate
+                , upload = layui.upload;
+            //图片上传接口
+            layedit.set({
+                uploadImage: {
+                    url: '/admin/notice/upImg' //接口url
+                    , type: 'post' //默认post
+                }
+            });
+
+            upload.render({
+                elem: '#test1' //绑定元素
+                , url: '/admin/notice/upImg' //上传接口
+                , headers: {"X-CSRF-TOKEN": "{{ csrf_token() }}"}
+                , done: function (res) {
+                    if (res.code == 0) {
+                        $("#img").val(res.data.src);
+                        layer.msg("上传图片成功!", {icon: 1});
+                    } else {
+                        layer.msg("上传图片发生错误!", {icon: 5});
+                    }
+                }
+                , error: function () {
+                    console.log('upload img error');
+                }
+            });
+
+            //执行实例
+            upload.render({
+                elem: '#test2' //绑定元素
+                , url: '/admin/notice/upImg' //上传接口
+                , headers: {"X-CSRF-TOKEN": "{{ csrf_token() }}"}
+                , done: function (res) {
+                    if (res.code == 0) {
+                        $("#mobileimg").val(res.data.src);
+                        layer.msg("上传图片成功!", {icon: 1});
+                    } else {
+                        layer.msg("上传图片发生错误!", {icon: 5});
+                    }
+                }
+                , error: function () {
+                    console.log('upload img error');
+                }
+            });
+
+            //var um = UM.getEditor('myEditor');
+            var um = UM.getEditor('myEditor', {
+                initialFrameWidth: 1000,
+                initialFrameHeight: 400
+            });
+            var umtwo = UM.getEditor('myEditortwo', {
+                initialFrameWidth: 1000,
+                initialFrameHeight: 400
+            });
+            /*var editIndex = layedit.build('LAY_demo_editor');*/
+            form.verify({
+                title: function (value) {
+                    if (value.length < 5) {
+                        return '标题至少得5个字符啊';
+                    }
+                }
+                , pass: [/(.+){6,12}$/, '密码必须6到12位']
+                , content: function (value) {
+                    layedit.sync(editIndex);
+                }
+            });
+
+
+            //监听提交
+            form.on('submit(submitForm)', function (data) {
+                return true;
+            });
+
+
+        });
+
+        //创建一个编辑器
+        function cbFormSuccess(data) {
+            layer.msg(data.msg);
+            setTimeout(function () {
+                window.history.go(-1)
+            }, 2500);
+        }
+    </script>
+@endsection

+ 1 - 0
resources/views/sports/sports_stringnotelist.blade.php

@@ -82,6 +82,7 @@
                         <label class="layui-form-label">{{ trans('sportsnotelist.account') }}</label>
                         <div class="layui-input-inline">
                             <input type="text" name="account" id="account" eventType="event-query"  value="{{ $account }}" lay-verify="required" autocomplete="off" class="layui-input">
+                            <input type="hidden" name="match_id" id="match_id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input">
                         </div>
                         <div class="layui-input-inline checkbox">
                             <input type="checkbox" name="sureblur" id="form_sureblur" lay-skin="switch" lay-text="精确|模糊" @if(!isset($sureblurs) || $sureblurs=='on') checked @endif  class="layui-input" eventType=event-query>