Thdj.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Thdj extends Lyapi_Controller{
  4. private $show_url = "https://lyerposs.wepolicy.cn";
  5. // 注意:登录接口不能受基础控制器的登录校验,可以覆盖构造方法或单独处理
  6. public function __construct() {
  7. // 这里不执行登录校验,只加载缓存驱动
  8. parent::__construct(); // 暂时注释,或者使用一个新的不校验的基类
  9. // 简便做法:复制 Lyapi_Controller 的部分代码但不调用 _check_api_auth
  10. // $this->load->driver('cache'); // 加载缓存驱动
  11. $this->load->_model("Model_logic_order","logic_order");
  12. $this->load->_model("Model_returns","returns");
  13. $this->load->_model("Model_aliyunossnew","aliyunossnew");
  14. }
  15. public function searchwaybill(){
  16. if($this->input->method(TRUE) != 'POST'){
  17. $this->_json_error('请求方式错误','500');
  18. }
  19. $waybill = $this->input->post('waybill',true);
  20. if(empty($waybill)){
  21. $this->_json_error('快递单号不能为空','500');
  22. }
  23. $waybill = $this->logic_order->getNeedWaybill($waybill);
  24. $info = $this->returns->find("torderinfo = '$waybill'");
  25. if(empty($info)){
  26. $this->_json_error('未查询到此快递单号'.$waybill,'500');
  27. }
  28. $res = $this->aliyunossnew->getOssSignType("shdjfile");
  29. if($res['code'] == -1){
  30. $this->_json_error($res["msg"],'500');
  31. }else{
  32. $this->_json_error('成功',200,[
  33. 'torderinfo'=>$info['torderinfo'],
  34. 'number'=>$info['number'],
  35. 'oss_config'=>$res['data']
  36. ]);
  37. }
  38. $this->_json_error($info,'200');
  39. }
  40. }