<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>

                >[success] 模型會自動對應數據表,模型類的命名規則是除去表前綴的數據表名稱,采用駝峰法命名,并且首字母大寫 | 模型名 | 約定對應數據表(假設數據庫的前綴定義是`zq_`) | | --- | --- | | User| zq_user | | UserType | zq_user_type | >[danger] 如果你的規則和上面的系統約定不符合,那么需要設置Model類的數據表名稱屬性,以確保能夠找到對應的數據表。 ``` <?php namespace app\model; use think\Model; class UserModel extends Model { protected $name = 'user'; // 設置當前模型對應的完整數據表名稱 protected $table = 'zq_user'; } ``` >[success] 模型類開啟支持自動寫入創建和更新的時間戳字段 ``` protected $autoWriteTimestamp = true; protected $createTime = 'ctime'; protected $updateTime = 'utime'; ``` >[success] 模型類開啟軟刪除,軟刪除的作用就是把數據加上刪除標記,而不是真正的刪除,同時也便于需要的時候進行數據的恢復。 ``` //軟刪除位 use SoftDelete; protected $deleteTime = 'is_del'; //設置軟刪除字段的默認值 protected $defaultSoftDelete = 0; ``` >[success] 在App/common/model目錄下創建用戶模型Manage.php,完整代碼如下: ``` <?php // +---------------------------------------------------------------------- // | najing [ 通用后臺管理系統 ] // +---------------------------------------------------------------------- // | Copyright (c) 2020 http://www.najingquan.com All rights reserved. // +---------------------------------------------------------------------- // | Author: 救火隊隊長 // +---------------------------------------------------------------------- namespace app\common\model; use think\model\concern\SoftDelete; class Manage extends Common { //時間自動存儲 protected $autoWriteTimestamp = true; protected $createTime = 'ctime'; protected $updateTime = 'utime'; //軟刪除位 use SoftDelete; protected $deleteTime = 'is_del'; //設置軟刪除字段的默認值 protected $defaultSoftDelete = 0; } ```
                  <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>

                              哎呀哎呀视频在线观看