<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ##開始使用 1. 填寫好控制器名稱 2. 填寫好表單元素 3. 點同步字段,會將表單元素自動同步到表字段,如果不想建表,也要點一下同步,不然前端校驗通過不了,包含 `id`、`status`、`isdelete`、`create_time`、`update_time` 的數據類型隨便填寫,模型會根據選項自動生成,不按此處選擇的數據類型生成 4. 勾選需要生成的首頁菜單 5. 勾選是否創建模型和驗證器 6. 點擊生成 ![](https://box.kancloud.cn/a00afca056af9784c09c2fa8395de641_1487x1083.png) ![](https://box.kancloud.cn/bf1ad532f76d3f1968b16541f55344c8_1409x373.png) ![](https://box.kancloud.cn/814acc604c19dfcd12ebb6d11565e9fa_1127x673.png) >[info] 以下代碼、日志全部是自動生成,沒有做任何修改,包括縮進,嚴格的縮進非常方便二次編輯和查閱 ##生成文件 ###controller/TestOne.php ``` <?php // +---------------------------------------------------------------------- // | tpadmin [a web admin based ThinkPHP5] // +---------------------------------------------------------------------- // | Copyright (c) 2016 tianpian All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: tianpian <tianpian0805@gmail.com> // +---------------------------------------------------------------------- //------------------------ // 測試一控制器 //------------------------- namespace app\admin\controller; use app\admin\Controller; class TestOne extends Controller { use \app\admin\traits\controller\Controller; protected $isdelete = false; protected function filter(&$map) { if ($this->request->param("name")) $map['name'] = ["like", "%" . $this->request->param("name") . "%"]; if ($this->request->param("mobile")) $map['mobile'] = ["like", "%" . $this->request->param("mobile") . "%"]; } } ``` ###view/test_one/index.html ``` {extend name="template/base" /} {block name="content"} <div class="page-container"> {include file='form' /} <div class="cl pd-5 bg-1 bk-gray"> <span class="l"> {include file="template/table_menu" menu="add,forbid,resume" /} </span> <span class="r pt-5 pr-5"> 共有數據 :<strong>{$count}</strong> 條 </span> </div> <table class="table table-border table-bordered table-hover table-bg mt-20"> <thead> <tr class="text-c"> {include file="th" /} <th width="70">操作</th> </tr> </thead> <tbody> {volist name="list" id="vo"} <tr class="text-c"> {include file="td" /} <td class="f-14"> {$vo.status|show_status=$vo.id} {tp:access action='edit'} <a title="編輯" href="javascript:;" onclick="layer_open('編輯','{:\\think\\Url::build(\'edit\',[\'id\'=>$vo[\'id\']])}')" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> {/tp:access} {tp:access action='delete'} <a title="刪除" href="javascript:;" onclick="del(this,'{$vo.id}','{:\\think\\Url::build(\'delete\')}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a> {/tp:access} </td> </tr> {/volist} </tbody> </table> <div class="page-bootstrap">{$page}</div> </div> {/block} ``` ###view/test_one/th.html ``` <th width="25"><input type="checkbox"></th> <th width="">{:sort_by('ID','id')}</th> <th width="">{:sort_by('姓名','name')}</th> <th width="">性別</th> <th width="">手機</th> <th width="">學歷</th> <th width="">備注</th> ``` ###view/test_one/td.html ``` <td><input type="checkbox" name="id[]" value="{$vo.id}"></td> <td>{$vo.id}</td> <td>{$vo.name|high_light=\\think\\Request::instance()->param('name')}</td> <td>{$vo.sex}</td> <td>{$vo.mobile|high_light=\\think\\Request::instance()->param('mobile')}</td> <td>{$vo.degree}</td> <td>{$vo.remark}</td> ``` ###view/test_one/form.html ``` <form class="mb-20" method="get" action="{:\\think\\Url::build(\\think\\Request::instance()->action())}"> <input type="text" class="input-text" style="width:250px" placeholder="姓名" name="name" value="{:\\think\\Request::instance()->param('name')}"> <input type="text" class="input-text" style="width:250px" placeholder="手機" name="mobile" value="{:\\think\\Request::instance()->param('mobile')}"> <button type="submit" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 搜索</button> </form> ``` ###view/test_one/edit.html ``` {extend name="template/base" /} {block name="content"} <div class="page-container"> <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}"> <input type="hidden" name="id" value="{:isset($vo.id)?$vo.id:''}"> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>姓名:</label> <div class="formControls col-xs-6 col-sm-6"> <input type="text" class="input-text" value="{:isset($vo.name)?$vo.name:''}" placeholder="" name="name" datatype="*" nullmsg="請填寫姓名"> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>性別:</label> <div class="formControls col-xs-6 col-sm-6 skin-minimal"> <div class="radio-box"> <input type="radio" name="sex" id="sex-0" value="" datatype="*" nullmsg="請選擇性別"> <label for="sex-0">選項一</label> </div> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3">手機:</label> <div class="formControls col-xs-6 col-sm-6"> <input type="text" class="input-text" value="{:isset($vo.mobile)?$vo.mobile:''}" placeholder="" name="mobile" datatype="m" errormsg="手機號格式錯誤" ignore="ignore"> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>學歷:</label> <div class="formControls col-xs-6 col-sm-6"> <div class="select-box"> <select name="degree" class="select" datatype="*" nullmsg="請選擇學歷"> <option value="">選項一</option> </select> </div> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <label class="form-label col-xs-3 col-sm-3">備注:</label> <div class="formControls col-xs-6 col-sm-6"> <textarea class="textarea" placeholder="" name="remark" onKeyUp="textarealength(this,100)">{:isset($vo.remark)?$vo.remark:''}</textarea> <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p> </div> <div class="col-xs-3 col-sm-3"></div> </div> <div class="row cl"> <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3"> <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button> <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> </div> </div> </form> </div> {/block} {block name="script"} <script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script> <script> $(function () { $("[name='sex'][value='{:isset($vo.sex)?$vo.sex:''}']").attr("checked",true); $("[name='degree']").find("[value='{:isset($vo.degree)?$vo.degree:''}']").attr("selected",true); $('.skin-minimal input').iCheck({ checkboxClass: 'icheckbox-blue', radioClass: 'iradio-blue', increaseArea: '20%' }); $("#form").Validform({ tiptype:2, ajaxPost:true, showAllError:true, callback:function(ret){ ajax_progress(ret); } }); }) </script> {/block} ``` ###validate/TestOne.php ``` <?php // +---------------------------------------------------------------------- // | tpadmin [a web admin based ThinkPHP5] // +---------------------------------------------------------------------- // | Copyright (c) 2016 tianpian All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: tianpian <tianpian0805@gmail.com> // +---------------------------------------------------------------------- //------------------------ // 測試一驗證器 //------------------------- namespace app\admin\validate; use think\Validate; class TestOne extends Validate { protected $rule = [ "name|姓名" => "require", "sex|性別" => "require", "mobile|手機" => "", "degree|學歷" => "require", ]; } ``` ###model/TestOne.php ``` <?php // +---------------------------------------------------------------------- // | tpadmin [a web admin based ThinkPHP5] // +---------------------------------------------------------------------- // | Copyright (c) 2016 tianpian All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: tianpian <tianpian0805@gmail.com> // +---------------------------------------------------------------------- //------------------------ // 測試一模型 //------------------------- namespace app\admin\model; use think\Model; class TestOne extends Model { // 指定表名,不含前綴 protected $name = 'test_one'; // 開啟自動寫入時間戳字段 protected $autoWriteTimestamp = 'int'; } ``` ##生成數據表 下面是 Linux 版 Navicat 截圖 ![](https://box.kancloud.cn/47f80669b3c6820f47aa7014835945cd_574x352.png) 下面是從 Linux 版 Navicat 中拷貝出的建表語句 ``` CREATE TABLE `tp_test_one` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '測試一主鍵', `name` varchar(255) DEFAULT NULL COMMENT '姓名', `sex` tinyint(1) DEFAULT NULL COMMENT '性別', `mobile` char(11) DEFAULT NULL COMMENT '手機', `degree` varchar(255) DEFAULT NULL COMMENT '學歷', `remark` varchar(255) NOT NULL COMMENT '備注', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '狀態,1-正常 | 0-禁用', `create_time` int(11) unsigned NOT NULL COMMENT '創建時間', `update_time` int(11) unsigned NOT NULL COMMENT '更新時間', PRIMARY KEY (`id`), KEY `id` (`id`), KEY `mobile` (`mobile`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='測試一'; ``` ##生成日志 runtime/log 目錄下的日志原文: >[info] 在當天的日志中搜索 build_sql 即可搜索到,日志原文中的標記是 BUILD_SQL ``` --------------------------------------------------------------- [ 2016-10-26T14:59:45+08:00 ] 127.0.0.1 127.0.0.1 POST /admin/generate/generate.html [ log ] tpadmin.dev/admin/generate/generate.html [運行時間:0.071346s][吞吐率:14.02req/s] [內存消耗:2,769.85kb] [文件加載:58] [ sql ] BUILD_SQL: DROP TABLE IF EXISTS `tp_test_one`; CREATE TABLE `tp_test_one` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '測試一主鍵', `name` varchar(255) COMMENT '姓名', `sex` tinyint(1) COMMENT '性別', `mobile` char(11) COMMENT '手機', `degree` varchar(255) COMMENT '學歷', `remark` varchar(255) NOT NULL COMMENT '備注', `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '狀態,1-正常 | 0-禁用', `create_time` int(11) unsigned NOT NULL COMMENT '創建時間', `update_time` int(11) unsigned NOT NULL COMMENT '更新時間', PRIMARY KEY (`id`), KEY `id` (`id`), KEY `mobile` (`mobile`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '測試一'; ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看