瀏覽代碼

fix:query bug

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
 }