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

                準備條件 下載thinkphp5框架[http://www.thinkphp.cn/](http://www.thinkphp.cn/) 模型 ~~~ <?php namespace app\model; use think\Model; class Placard extends Model { // 定義時間戳字段名 protected $autoWriteTimestamp = true;// 關閉自動寫入時間戳 } ~~~ 驗證機制 ~~~ <?php namespace app\common\validate; use think\Validate; class Placard extends Validate{ protected $rule=[ ]; protected $message=[ ]; /** * 自定義驗證規則 * @param $value * @return bool */ protected function checkPhone($value) { return preg_match("/^1[0345789]{1}\d{9}$/",$value)?true:false; } } ~~~ 增加操作 ~~~ function add(){ $data['agent_id']= input('agent_id'); $data['textarea']= input('textarea'); $validate_result = $this->validate($data,'Placard'); if ($validate_result!==true){ $this->error($validate_result); }else{ if (PlacardMoble::create($data)){ $this->success('發布成功'); }else{ $this->error('發布失敗'); } } } ~~~ 修改操作 ~~~ public function update() { $placard = PlacardMoble::get(11); $placard->agent_id=1; $placard->textarea=33; $validate_result = $this->validate($placard,'Placard'); if ($validate_result!==true){ $this->error($validate_result); }else{ if ( $placard->save()){ $this->success('更新成功'); }else{ $this->error('更新失敗'); } } } ~~~ 刪除操作 ~~~ public function del($id){ if ( @PlacardMoble::get($id)->delete()){ $this->success('刪除成功'); }else{ $this->error('刪除失敗'); } } ~~~
                  <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>

                              哎呀哎呀视频在线观看