BasicActTrait.php 658 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Traits;
  3. trait BasicActTrait
  4. {
  5. public function getPage($page)
  6. {
  7. if ($page['Id'] < 0) {
  8. $page = ['Id' => $page['Id']];
  9. } else if ($page['Id'] > 0) {
  10. unset($page['CreatedOn']);
  11. } else {
  12. unset($page['UpdatedOn']);
  13. }
  14. return $page;
  15. }
  16. public function callActOrPick($url, $page)
  17. {
  18. return $this->callApiService->callApi([
  19. 'url' => $url,
  20. 'data' => [
  21. 'Page' => $page
  22. ],
  23. ]);
  24. }
  25. public function getApiUrl($name, $type)
  26. {
  27. return $name . '-' . $type;
  28. }
  29. }