Apiexpressv1.php 1018 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. /**
  4. * 这个是快递回执给erp的信息,目前先写在这 不想在写到api那个文件了
  5. */
  6. class Apiexpressv1 extends Start_Controller{
  7. public function __construct(){
  8. parent::__construct();
  9. $this->load->_model('Model_logic_order','api');
  10. $this->load->_model("Model_logic_ding",'logic_ding');
  11. }
  12. //定义方法的调用规则 获取URI第二段值
  13. public function _remap($arg,$arg_array)
  14. {
  15. if($arg == 'notifyusps')//添加
  16. {
  17. $this->_notifyusps();
  18. }else{
  19. $this->_a();
  20. }
  21. }
  22. public function _a(){
  23. exit('No direct script access allowed');
  24. }
  25. //usps获取快递回执信息
  26. public function _notifyusps(){
  27. $str = file_get_contents('PHP://input');
  28. $data = json_decode($str, true);
  29. $this->logic_ding->sendToDing(json_encode($data,JSON_UNESCAPED_UNICODE));
  30. echo "SUCCESS";
  31. }
  32. }