Guest User

Untitled

a guest
Sep 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $productid = 'abc'; //sample product id
  2. for($i = 0; $i < $perPage; $i++){
  3. $product = Product::where("product-new", $productid)->get()->toArray();
  4. if($product){
  5. $result[] = $product[0];
  6. $productid = $product[0]['product-old']; //xyz
  7. }
  8.  
  9. $productid = 'abc'; //sample product id
  10. for($i = 0; $i < $perPage; $i++){
  11. $product = Product::where("product-new", $productid)->get()->toArray();
  12. if($product){
  13. $result[] = $product[0];
  14. $productid = $product[0]['product-old']; //xyz
  15. }
  16.  
  17. if ($product){
  18. $result[] = $product[0];
  19. $productid = $product[0]['product-old']; //xyz
  20. } else {
  21. break;
  22. }
Add Comment
Please, Sign In to add comment