|
@@ -10,6 +10,7 @@ namespace app\portal\controller; |
|
@@ -10,6 +10,7 @@ namespace app\portal\controller; |
10
|
|
10
|
|
11
|
|
11
|
|
12
|
use app\portal\model\IndentModel;
|
12
|
use app\portal\model\IndentModel;
|
|
|
13
|
+use app\portal\model\LogisticsModel;
|
13
|
use cmf\controller\HomeBaseController;
|
14
|
use cmf\controller\HomeBaseController;
|
14
|
|
15
|
|
15
|
class LoadController extends HomeBaseController
|
16
|
class LoadController extends HomeBaseController
|
|
@@ -32,9 +33,8 @@ class LoadController extends HomeBaseController |
|
@@ -32,9 +33,8 @@ class LoadController extends HomeBaseController |
32
|
dump(cache('data'));
|
33
|
dump(cache('data'));
|
33
|
}
|
34
|
}
|
34
|
public function notify(){
|
35
|
public function notify(){
|
35
|
-
|
|
|
36
|
- $RequestType = $_POST['RequestType'];
|
|
|
37
|
- $RequestData = $_POST['RequestData'];
|
36
|
+ $RequestType = empty($_POST['RequestType']) ? 0: $_POST['RequestType'];
|
|
|
37
|
+ $RequestData = empty($_POST['RequestData']) ? 0: $_POST['RequestData'];
|
38
|
if(empty($RequestType)){
|
38
|
if(empty($RequestType)){
|
39
|
$this->error('error');
|
39
|
$this->error('error');
|
40
|
}
|
40
|
}
|
|
@@ -42,10 +42,21 @@ class LoadController extends HomeBaseController |
|
@@ -42,10 +42,21 @@ class LoadController extends HomeBaseController |
42
|
$this->error('error');
|
42
|
$this->error('error');
|
43
|
}
|
43
|
}
|
44
|
$result = json_decode($RequestData,true);
|
44
|
$result = json_decode($RequestData,true);
|
|
|
45
|
+ $indentModel = new IndentModel();
|
|
|
46
|
+ foreach($result['data'] as $key => $vo){
|
|
|
47
|
+ $indent = $indentModel->findData(['logistic_code'=>$vo['LogisticCode']]);
|
|
|
48
|
+ if(!empty($indent)){
|
|
|
49
|
+ if($vo['state'] >=1 && $vo['state'] != 4){
|
|
|
50
|
+ if($indent['state'] == 2){
|
|
|
51
|
+ $indentModel->updateData(['id'=>$indent['id']],['state'=>5]);
|
|
|
52
|
+ }
|
|
|
53
|
+ }
|
|
|
54
|
+ }
|
|
|
55
|
+ }
|
45
|
cache('result',$result);
|
56
|
cache('result',$result);
|
46
|
$bird = config('bird');
|
57
|
$bird = config('bird');
|
47
|
$date = date("Y-m-d H:i:s",time());
|
58
|
$date = date("Y-m-d H:i:s",time());
|
48
|
- $data = '{ "EBusinessID": "test1472267", "UpdateTime": "'.$date.'", "Success": true, "Reason": ""}';
|
59
|
+ $data = '{ "EBusinessID": "'.$bird['EBusinessID'].'", "UpdateTime": "'.$date.'", "Success": true, "Reason": ""}';
|
49
|
cache('data',$data);
|
60
|
cache('data',$data);
|
50
|
return $data;
|
61
|
return $data;
|
51
|
}
|
62
|
}
|