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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                1.連上數據庫 ~~~ // 數據庫名 'database' => 'xcx', // 用戶名 'username' => 'root', // 密碼 'password' => '123456', ~~~ 2.完善路由 ~~~ Route::get('api/v1/banner/:id','api/v1.Banner/getBanner'); ~~~ 3.model中Banner.php代碼 ~~~ <?php namespace app\api\model; use think\Db; use think\Model; class Banner { public static function getBannerById($id) { $result=Db::query('select * from banner_item where banner_id=?',[$id]); return $result; } } ~~~ 3.操作器中Banner.php代碼 ~~~ <?php namespace app\api\controller\v1; use app\api\validate\IDMustBePostiveInt; use app\api\model\Banner as BannerModel; use app\lib\exception\BannerMissException; class Banner{ //獲取指定id的banner信息 public function getBanner($id) { (new IDMustBePostiveInt())->goCheck(); $banner=BannerModel::getBannerByID($id); if(!$banner){ throw new BannerMissException(); } return json($banner); } } ~~~ 結果 ![](https://box.kancloud.cn/b448947c9f9cedcb309fa73e290ec67c_929x490.png) ![](https://box.kancloud.cn/cfdb8aa420462008106942873912b076_1130x560.png)
                  <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>

                              哎呀哎呀视频在线观看