本文整理汇总了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;
}
示例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();
}
示例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;
}