|
|
@@ -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);
|
|
|
}
|
|
|
|