|
|
@@ -0,0 +1,43 @@
|
|
|
+<?php
|
|
|
+defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
+
|
|
|
+class Thdj extends Lyapi_Controller{
|
|
|
+
|
|
|
+ private $show_url = "https://lyerposs.wepolicy.cn";
|
|
|
+ // 注意:登录接口不能受基础控制器的登录校验,可以覆盖构造方法或单独处理
|
|
|
+ public function __construct() {
|
|
|
+ // 这里不执行登录校验,只加载缓存驱动
|
|
|
+ parent::__construct(); // 暂时注释,或者使用一个新的不校验的基类
|
|
|
+ // 简便做法:复制 Lyapi_Controller 的部分代码但不调用 _check_api_auth
|
|
|
+ // $this->load->driver('cache'); // 加载缓存驱动
|
|
|
+ $this->load->_model("Model_logic_order","logic_order");
|
|
|
+ $this->load->_model("Model_returns","returns");
|
|
|
+ $this->load->_model("Model_aliyunossnew","aliyunossnew");
|
|
|
+ }
|
|
|
+ public function searchwaybill(){
|
|
|
+ if($this->input->method(TRUE) != 'POST'){
|
|
|
+
|
|
|
+ $this->_json_error('请求方式错误','500');
|
|
|
+ }
|
|
|
+ $waybill = $this->input->post('waybill',true);
|
|
|
+ if(empty($waybill)){
|
|
|
+ $this->_json_error('快递单号不能为空','500');
|
|
|
+ }
|
|
|
+ $waybill = $this->logic_order->getNeedWaybill($waybill);
|
|
|
+ $info = $this->returns->find("torderinfo = '$waybill'");
|
|
|
+ if(empty($info)){
|
|
|
+ $this->_json_error('未查询到此快递单号'.$waybill,'500');
|
|
|
+ }
|
|
|
+ $res = $this->aliyunossnew->getOssSignType("shdjfile");
|
|
|
+ if($res['code'] == -1){
|
|
|
+ $this->_json_error($res["msg"],'500');
|
|
|
+ }else{
|
|
|
+ $this->_json_error('成功',200,[
|
|
|
+ 'torderinfo'=>$info['torderinfo'],
|
|
|
+ 'number'=>$info['number'],
|
|
|
+ 'oss_config'=>$res['data']
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ $this->_json_error($info,'200');
|
|
|
+ }
|
|
|
+}
|