feat: 从产品目录同步产品相关数据

This commit is contained in:
2025-07-02 10:42:48 +08:00
parent 401658981c
commit c08900c694
5 changed files with 235 additions and 71 deletions

View File

@@ -29,6 +29,12 @@ class ProductCategoryModel extends ProductCategoryBaseModel
$query->where('language_id', '=', $value);
}
// 所属产品目录分类id查询
public function scopeTcoId($query, $value)
{
$query->where('related_tco_category', '=', $value);
}
/**
* 根据是否显示查询
* @param $query

View File

@@ -80,6 +80,12 @@ class ProductModel extends ProductBaseModel
$query->where('category_id', '=', $value);
}
// 规格型号查询
public function scopeSpu($query, $spu)
{
$query->where('spu', '=', $spu);
}
// 启用状态查询
public function scopeEnabled($query)
{

View File

@@ -23,6 +23,12 @@ class ProductTcoCategoryModel extends ProductTcoCategoryBaseModel
$query->where('language_id', '=', $value);
}
// 根据 tco_id 查询
public function scopeTcoId($query, $value)
{
$query->where('tco_id', '=', $value);
}
// 根据ERP Code查询
public function scopeErpCode($query, $value)
{