Browse Source

工单资料

qiuenguang 1 year ago
parent
commit
4532b9f5ab
1 changed files with 10 additions and 21 deletions
  1. 10 21
      application/api/controller/WorkOrder.php

+ 10 - 21
application/api/controller/WorkOrder.php

@@ -19,21 +19,6 @@ class WorkOrder extends Api
     protected $noNeedLogin = ['*'];
     protected $noNeedRight = ['*'];
 
-    public function _initialize()
-    {
-
-        if (isset($_SERVER['HTTP_ORIGIN'])) {
-            header('Access-Control-Expose-Headers: __token__');//跨域让客户端获取到
-        }
-        //跨域检测
-        check_cors_request();
-
-        if (!isset($_COOKIE['PHPSESSID'])) {
-            Config::set('session.id', $this->request->server("HTTP_SID"));
-        }
-        parent::_initialize();
-    }
-
     /**
      * 工单资料菜单列表
      *
@@ -2285,12 +2270,16 @@ class WorkOrder extends Api
             ->where('订单编号',$param['order'])
             ->order('子订单编号 desc')
             ->find();
-        $num = (int)substr($data['子订单编号'],10) + 1;
-        if ($num<10){
-            $order = $param['order'].'-0'.$num;
-        }else{
-            $order = $param['order'].'-'.$num;
-        }
+       if(empty($data)){
+           $order = $param['order'].'-01';
+       }else{
+           $num = (int)substr($data['子订单编号'],10) + 1;
+           if ($num<10){
+               $order = $param['order'].'-0'.$num;
+           }else{
+               $order = $param['order'].'-'.$num;
+           }
+       }
         $this->success('成功',$order);
     }