feat: 添加获取系统前台各模块url接口
This commit is contained in:
@@ -22,6 +22,12 @@ class ArticleCategoryModel extends ArticleCategoryBaseModel
|
||||
$query->where('language_id', '=', $lang_id);
|
||||
}
|
||||
|
||||
// 根据是否显示查询
|
||||
public function scopeIsShow($query, bool $is_show)
|
||||
{
|
||||
$query->where('is_show', '=', (int)$is_show);
|
||||
}
|
||||
|
||||
// 搜索分类名
|
||||
public function searchNameAttr($query, $value, $data)
|
||||
{
|
||||
|
||||
@@ -61,4 +61,10 @@ class ArticleModel extends ArticleBaseModel
|
||||
}
|
||||
$query->where('category_id', '=', $value);
|
||||
}
|
||||
|
||||
// 已启用的查询
|
||||
public function scopeEnabled($query)
|
||||
{
|
||||
$query->where('enabled', '=', 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,12 @@ class ProductCategoryModel extends ProductCategoryBaseModel
|
||||
$query->where('language_id', '=', $value);
|
||||
}
|
||||
|
||||
// 根据是否显示查询
|
||||
public function scopeIsShow($query, bool $value)
|
||||
{
|
||||
$query->where('is_show', '=', (int)$value);
|
||||
}
|
||||
|
||||
// 搜索分类名称
|
||||
public function searchNameNullableAttr($query, $value, $data)
|
||||
{
|
||||
|
||||
@@ -67,6 +67,10 @@ class ProductModel extends ProductBaseModel
|
||||
}
|
||||
$query->where('category_id', '=', $value);
|
||||
}
|
||||
public function scopeCategory($query, $value)
|
||||
{
|
||||
$query->where('category_id', '=', $value);
|
||||
}
|
||||
|
||||
// 上架状态查询
|
||||
public function scopeIsShowNullable($query, bool|null $value)
|
||||
@@ -76,4 +80,8 @@ class ProductModel extends ProductBaseModel
|
||||
}
|
||||
$query->where('is_show', '=', (int)$value);
|
||||
}
|
||||
public function scopeIsShow($query, bool $value)
|
||||
{
|
||||
$query->where('is_show', '=', (int)$value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user