Roc преди 4 месеца
родител
ревизия
972f355a51
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      models/company_product.go

+ 2 - 2
models/company_product.go

@@ -437,12 +437,12 @@ func GetCompanyProductItemListByCompanyIdList(companyIdList []int, productId int
 // @param productId int
 // @return items []*CompanyProductItem
 // @return err error
-func GetCompanyProductItemByCompanyId(companyId int, productId int) (items *CompanyProductItem, err error) {
+func GetCompanyProductItemByCompanyId(companyId int, productId int) (item *CompanyProductItem, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT a.* FROM company_product as a 
          JOIN company b on a.company_id=b.company_id
          WHERE a.company_id = ? AND a.product_id = ? `
-	_, err = o.Raw(sql, companyId, productId).QueryRows(&items)
+	err = o.Raw(sql, companyId, productId).QueryRow(&item)
 
 	return
 }