/** * 根据商家id获取该商家的所有产品 * @param 商家id $vendorID */ public function getCountProductByVendorID($vendorID) { $dao = new DaoProduct(); return $dao->getCountProductByVendorId($vendorID); }
/** * */ public function getAllVendorInfo($vendorId) { $res = array(); // 根据id获取商家信息 $dao = new DaoVendor(); $vendors = $dao->getVendorById($vendorId); if (count($vendors) == 1) { $vendor = $vendors[0]; //获取法人验证信息id $idenId = $vendor['vendor_iden_id']; if ($idenId != null) { $daoVendorAuth = new DaoVendorAuth(); $res['iden'] = $daoVendorAuth->getVendorAuthById($idenId); } //获取公司验证信息id $certiId = $vendor['vendor_certi_id']; if ($certiId != null) { $daoVendorAuth = new DaoVendorAuth(); $res['certi'] = $daoVendorAuth->getVendorAuthById($certiId); } //获取公司信息id $info_id = $vendor['vendor_info_id']; if ($info_id) { $dao = new DaoVendorInfo(); $res['info'] = $dao->getVendorInfoById($info_id); } //获取产品总数 $dao = new DaoProduct(); $res['productSum'] = $dao->getCountProductByVendorId($vendorId); } return $res; }