Guest User

Untitled

a guest
Oct 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. # Initial, query brands, comments pt fiecare oferta
  2. <?php
  3. foreach ($offers as $offer) {
  4. $offers_ids[] = $offer['offer_id'];
  5.  
  6. $offerComments[$offer['offer_id']] = $tbOfferComment->getOfferComments($offer['offer_id']); // apelare pt luat comments
  7. $offerBrands[$offer['offer_id']] = $brandOfferTable->getBrandsByOfferId($offer['offer_id']); // apelare pt luat brands
  8. $members = $offerRestrictionTb->fetchRow(array('offer_id = ?' => $offer['offer_id'], 'restriction_type_id = ?' => 4));
  9. if ($members) {
  10. $offerMembers[] = $members->offer_id;
  11. }
  12. }
  13. ?>
  14. #
  15. <?php
  16. $offerIds = array(); // lista id-uri oferte
  17. foreach ($offers as $offer) {
  18. $offers_ids[] = $offer['offer_id'];
  19. if ($offer['restriction_type_id']==4) {
  20. $offerMembers[] = $offer['offer_id'];
  21. }
  22. }
  23. // returneze array asociativ
  24. $offerComments = $tbOfferComment->getOffersComments($offerIds);
  25. $offerBrands = $brandOfferTable->getBrandsByOfferIds($offerIds);
  26.  
  27. ?>
Add Comment
Please, Sign In to add comment