Api.php 823 B

123456789101112131415161718192021222324252627282930313233
  1. <?php namespace Api\Lib;
  2. use Dever;
  3. class Api extends Platform
  4. {
  5. protected $type = 'api';
  6. # 执行某个接口
  7. public function run($id, $param = array())
  8. {
  9. $state = $this->setting($id, $param);
  10. if (!$state) {
  11. return $state;
  12. }
  13. return $this->curl();
  14. }
  15. # 跳转
  16. public function jump($id, $param = array())
  17. {
  18. $state = $this->setting($id, $param);
  19. if (!$state) {
  20. return $state;
  21. }
  22. return $this->location();
  23. }
  24. # 生成回调
  25. protected function createNotify($order_num)
  26. {
  27. $encode = \Dever\Helper\Str::encode($this->info['id'] . '|' . $order_num);
  28. return Dever::url('api/notify.common', array('s' => $encode), false, 'src/channel/api/');
  29. }
  30. }