當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Category::tableName方法代碼示例

本文整理匯總了PHP中common\models\Category::tableName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Category::tableName方法的具體用法?PHP Category::tableName怎麽用?PHP Category::tableName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在common\models\Category的用法示例。


在下文中一共展示了Category::tableName方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: search

 public function search($params)
 {
     $query = Category::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $dataProvider->setSort(['defaultOrder' => ['updatedOn' => SORT_DESC]]);
     $query->andFilterWhere([Category::tableName() . '.status' => '1']);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status, 'parentId' => $this->parentId, 'is_fg' => $this->is_fg, 'is_event' => $this->is_event]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'ip', $this->ip]);
     return $dataProvider;
 }
開發者ID:rajanishtimes,項目名稱:partnerapi,代碼行數:13,代碼來源:CategorySearch.php

示例2: isShowInNav

 /**
  * 判斷顯示
  * @param string $type
  * @param integer $id
  */
 public static function isShowInNav($type, $id)
 {
     if ($type == 'c') {
         $tablename = Category::tableName();
     } else {
         $tablename = ArticleCat::tableName();
     }
     $conn = \Yii::$app->getDb();
     return $conn->createCommand("SELECT show_in_nav FROM " . $tablename . " WHERE id={$id}")->queryScalar();
 }
開發者ID:styleyoung,項目名稱:taoshop,代碼行數:15,代碼來源:Nav.php

示例3: getCategoryCountTotalSql

    public static function getCategoryCountTotalSql()
    {
        $param = self::CATEGOTY_COUNT_TOTAL;
        $categoryTable = Category::tableName();
        return $sql = <<<SQL
select '{$param}' as param, count(*) as value from {$categoryTable} where active = 1
SQL;
        return null;
    }
開發者ID:roman444uk,項目名稱:moja-objava,代碼行數:9,代碼來源:DataInformer.php


注:本文中的common\models\Category::tableName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。