feat: 添加获取系统前台各模块url接口

This commit is contained in:
2025-03-14 17:58:36 +08:00
parent 32ccd0e367
commit e4e5b6583f
7 changed files with 178 additions and 4 deletions

View File

@@ -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)
{

View File

@@ -61,4 +61,10 @@ class ArticleModel extends ArticleBaseModel
}
$query->where('category_id', '=', $value);
}
// 已启用的查询
public function scopeEnabled($query)
{
$query->where('enabled', '=', 1);
}
}

View File

@@ -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)
{

View File

@@ -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);
}
}