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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Service層 services層屬于Model層之下(niucloud-admin框架沒有DAO層),是最接近控制器層的。所有的業務邏輯都可以寫在services層中。 ### sservice層包括model實例的變量,request請求兩個字段 ~~~ protected $model; protected $request; ~~~ ### service內置方法 獲取當前分頁頁碼和展示條數,會根據系統配置返回不大于配置的展示條數 ~~~ public function getPageParam() ~~~ 獲取分頁列表 ~~~ public function getPageList(Model $model, array $where, string $field = '*', string $order = '', array $append = [], $with = null, $each = null){ ~~~ 分頁數據查詢,傳入model(查詢后結果) ~~~ public function pageQuery($model, $each = null) ~~~ 分頁視圖列表查詢 ~~~ public function getPageViewList(Model $model, array $where, string $field = '*', string $order = '', array $append = [], $with = null, $each = null) ~~~ ### BaseService類按照端口,有以下子類 **BaseCoreService、 BaseAdminService、 BaseApiService** 這幾個類的文件都定義在 niucloud\core\base 文件夾中。 BaseCoreService是所有內核服務類的基類,對于可能在多個端口都會調用的service類,一般繼承自他。 BaseAdminService是Admin管理端的Service的基類,該類實現了站點端(商家端、租戶端)的site_id 的變量的賦值和取值,當前登錄的用戶名和uid字段。 ``` class BaseAdminService extends BaseService { protected $site_id; protected $username; protected $uid; protected $app_type; public function __construct() { parent::__construct(); $this->app_type = $this->request->appType(); $this->site_id = $this->request->siteId(); $this->username = $this->request->username(); $this->uid = $this->request->uid(); } } ``` BaseApiService是前端API(web、uni-app)的Service的基類,該類實現了site_id 的變量的取值,當前登錄的會員ID(member_id)和登錄方式的字段取值。 ``` class BaseApiService extends BaseService { protected $site_id; protected $member_id; protected $channel; public function __construct() { parent::__construct(); $this->site_id = $this->request->siteId(); $this->member_id = $this->request->memberId(); $this->channel = $this->request->getChannel(); } } ```
                  <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>

                              哎呀哎呀视频在线观看