thinkphp里的isPost的问题,怎么接收不到数据呢???

php专注 发布于 11/06 10:04
阅读 40
收藏 0

为什么isPost接收不到数据呢?

用thinkphp写代码是这样写的,完全接收不到input的值

public function site()
    {   
        if(request()->isPost()){

                $dateStart=input('start');
                $dateEnd=input('end');
       }

html代码难道我写的不正确吗?如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            图多多管理系统
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="__STATIC__/admin/css/x-admin.css" media="all">
         <script src="__STATIC__/admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="__STATIC__/admin/js/x-layui.js" charset="utf-8"></script>
    </head>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>网站设置</cite></a>
              <a><cite>站点数据</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
        <div class="x-body">
            <form class="layui-form x-center" action="{:url('system/site')}" style="width:80%"  method="post">
                <div class="layui-form-pane" style="margin-top: 15px;">
                  <div class="layui-form-item">
                    <label class="layui-form-label">日期范围</label>
                    <div class="layui-input-inline">
                      <input class="layui-input" placeholder="开始日" name="start" id="LAY_demorange_s" value="">
                    </div>
                    <div class="layui-input-inline">
                      <input class="layui-input" placeholder="截止日"  name="end" id="LAY_demorange_e">
                    </div>
                    
                    <div class="layui-input-inline" style="width:80px">
                        <button class="layui-btn"  lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
                    </div>
                  </div>
                </div> 
            </form>
            
            <table class="layui-table">
                <thead>
                    <tr>
                        
                        <th>
                            作品数量
                        </th>
                        <th>
                            会员数
                        </th>
                        <th>
                            下载量
                        </th>
                        <th>
                            会员总金
                        </th>
                        <th>
                            成交额
                        </th>
                        <th>
                            提现额
                        </th>
                        <th>
                            站点余额
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        
                        <td>
                           {$opus}
                        </td>
                        <td>
                            {$user}
                        </td>
                        <td >
                            {$down}
                        </td>
                        <td >
                           12345
                        </td>
                        <td >
                            12345
                        </td>
                        <td>
                            12345
                        </td>
                        <td >
                            12345
                        </td>
                        
                    </tr>
                </tbody>
            </table>

           
       
        <script>
            layui.use(['laydate','element','layer'], function(){
                $ = layui.jquery;//jquery
              laydate = layui.laydate;//日期插件
              lement = layui.element();//面包导航
              
              layer = layui.layer;//弹出层

              //以上模块根据需要引入

              
              
              var start = {
                min: '2000-01-1 00:00:00'
                ,max: '2099-06-16 23:59:59'
                ,istoday: false
                ,choose: function(datas){
                  end.min = datas; //开始日选好后,重置结束日的最小日期
                  end.start = datas //将结束日的初始值设定为开始日
                }
              };
              
              var end = {
                min: laydate.now()
                ,max: '2099-06-16 23:59:59'
                ,istoday: false
                ,choose: function(datas){
                  start.max = datas; //结束日选好后,重置开始日的最大日期
                }
              };
              
              document.getElementById('LAY_demorange_s').onclick = function(){
                start.elem = this;
                laydate(start);
              }
              document.getElementById('LAY_demorange_e').onclick = function(){
                end.elem = this
                laydate(end);
              }
              
            });

            
            </script>
            
    </body>
</html>

 

加载中
返回顶部
顶部