| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function run() |
||
| 11 | { |
||
| 12 | $params = Yii::$app->request->getBodyParams(); |
||
| 13 | $arrayData = json_decode(base64_decode($params['data']), true); |
||
| 14 | $orderId = $arrayData['orderId']; |
||
| 15 | if (($order = Order::findOne(['sn' => Order::SOURCE_JD . $orderId])) == null) { |
||
| 16 | throw new NotFoundHttpException('订单不存在'); |
||
| 17 | } |
||
| 18 | $data = []; |
||
| 19 | if ($order->status > 2) { |
||
| 20 | $data['orderStatus'] = 0; |
||
| 21 | } elseif ($order->status > -1) { |
||
| 22 | $data['orderStatus'] = 1; |
||
| 23 | } else { |
||
| 24 | $data['orderStatus'] = 2; |
||
| 25 | } |
||
| 26 | return $data; |
||
| 27 | } |
||
| 28 | } |
||
| 29 |