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

                ### tp框架 數據庫填充默認是沒有 創建時間 跟 修改時間的字段,所以需要我們手動添加 ### 第一步 需要在數據庫加入兩個字段,分別是create_at 跟update_at,兩個字段 兩個字段添加大家可以用軟件,也可以用的phpmyadmin ,我用的是三葉草軟件 ![](https://box.kancloud.cn/ab19dd422a540b440803a5c886c97041_1858x464.png) ## 第二步 需要在模型中指定開啟添加時間戳,直接復制放在自己模型中就可以 ~~~ protected $pk = 'id'; //默認主鍵 protected $table = 'zh_user'; //默認數據表 protected $autoWriteTimestamp = true; //開啟自動時間戳 //定義時間戳字段名:默認為create_time和create_time,如果一致可省略 //如果想關閉某個時間戳字段,將值設置為false即可:$create_time = false protected $createTime = 'create_time'; //創建時間字段 protected $updateTime = 'update_time'; //更新時間字段 protected $dateFormat = 'Y年m月d日'; //時間字段取出后的默認時間格式 //自動完成設置 protected $auto = []; // 僅新增時設置 protected $insert = ['create_at','status'=>1,'is_top'=>0,'is_hot'=>0]; //僅更新時設置 protected $update = ['update_at']; ~~~ ![](https://box.kancloud.cn/11fc4f86281adec1a15802ac4bdef486_1786x544.png) # 注意 添加數據需要用save方法 ~~~ \model('article')->save($data); 表名字 數據名字 ~~~
                  <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>

                              哎呀哎呀视频在线观看