Advertisement
evgeniy-bublik

Untitled

Mar 18th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. /**
  2. * Get list result periods
  3. *
  4. * @return array
  5. */
  6. public function getListResultPeriods()
  7. {
  8. return [
  9. 'Bad',
  10. 'Good',
  11. ];
  12. }
  13.  
  14. /**
  15. * Get periods for products from request.
  16. *
  17. * @access private
  18. *
  19. * @param
  20. *
  21. * @return array
  22. */
  23. private function getProductPeriodsFromRequest($request)
  24. {
  25. $periods = [];
  26.  
  27. $from = $request->get('period_from', []);
  28. $to = $request->get('period_to', []);
  29. $result = $request->get('allow', []);
  30. $comments = $request->get('comment', []);
  31.  
  32. foreach ($from as $index => $data) {
  33. if (isset($to[ $index ]) && isset($result[ $index ])) {
  34. $md5 = md5($data . ' ' . $to[ $index]);
  35. $periods[ $md5 ] = [
  36. 'from' => $data,
  37. 'to' => $to[ $index ],
  38. 'allow' => $result[ $index ],
  39. 'comment' => $comments[ $index ],
  40. ];
  41. }
  42. }
  43.  
  44. return $periods;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement