package service

import (
	"go_sku_server/model"
	"go_sku_server/pkg/mysql"
)

type LySupplier struct {

}

/**
获取基石供应商详情(基石)
@author wangsong
@param SupplierId 供应商Id
 */
func (L *LySupplier) GetSupplirInfo(SupplierId int) (bool,error,*model.SupplierEntity) {

	supplierEntity:= &model.SupplierEntity{}
	has,err:= mysql.Conn("spu").Table("lie_supplier").Where("supplier_id=?",SupplierId).Get(supplierEntity)
	return has,err,supplierEntity

}

/**
获取联营供应商详情(联营供应商)
@author wangsong
@param supplierCode 供应商渠道创建人
 */
func (L *LySupplier)  GetPoolSupplirInfo(supplierCode string)  (bool,error,*model.PoolSupplierEntity){

	poolSupplierEntity:= &model.PoolSupplierEntity{}
	has,err:= mysql.Conn("supp").Table("lie_supplier_channel").Where("supplier_code=?",supplierCode).Get(poolSupplierEntity);
	return has,err,poolSupplierEntity

}