新增产品信息用户查询接口
This commit is contained in:
@@ -20,6 +20,27 @@ func (s *productService) AllProducts() ([]*m.Product, error) {
|
||||
Find()
|
||||
}
|
||||
|
||||
func (s *productService) AllProductSaleInfos() ([]*m.Product, error) {
|
||||
return q.Product.
|
||||
Joins(q.Product.Skus).
|
||||
Select(
|
||||
q.Product.ID,
|
||||
q.Product.Code,
|
||||
q.Product.Name,
|
||||
q.Product.Description,
|
||||
q.Product.Sort,
|
||||
q.ProductSku.ID,
|
||||
q.ProductSku.Code,
|
||||
q.ProductSku.Name,
|
||||
q.ProductSku.Price,
|
||||
).
|
||||
Where(
|
||||
q.Product.Status.Eq(int(m.ProxyStatusOnline)),
|
||||
q.ProductSku.Status.Eq(int32(m.ProductStatusEnabled)),
|
||||
).
|
||||
Find()
|
||||
}
|
||||
|
||||
// 新增产品
|
||||
func (s *productService) CreateProduct(create *CreateProductData) error {
|
||||
return q.Product.Create(&m.Product{
|
||||
|
||||
Reference in New Issue
Block a user