|
@@ -8,13 +8,13 @@ import (
|
|
|
|
|
|
// GetByCompany2ProductId 根据客户id和产品id获取信息
|
|
|
func GetByCompany2ProductId(companyId, productId int64) (item *CompanyProduct, err error) {
|
|
|
- err = global.DEFAULT_MYSQL.Where("company_id = ? and product_id", companyId, productId).First(&item).Error
|
|
|
+ err = global.DEFAULT_MYSQL.Where("company_id = ? and product_id=?", companyId, productId).First(&item).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// GetListByCompanyId 根据客户id获取所有的产品信息列表
|
|
|
func GetListByCompanyId(companyId int64) (items []*CompanyProduct, err error) {
|
|
|
- err = global.DEFAULT_MYSQL.Where("company_id = ? and product_id", companyId).Find(&items).Error
|
|
|
+ err = global.DEFAULT_MYSQL.Where("company_id = ? ", companyId).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|