|
|
@@ -37,17 +37,15 @@ class MtController extends PublicController
|
|
|
}
|
|
|
|
|
|
$data = arrayUtil::humpUnderlineConversion($post, 1);
|
|
|
+ $orderId = $data['orderId'];
|
|
|
+ $mtOrder = MtOrderClass::getByCondition(['orderId' => $orderId]);
|
|
|
+ if (!empty($mtOrder)) {
|
|
|
+ Yii::warning('订单号已存在:' . $orderId);
|
|
|
+ return Json::encode(['data' => 'ok']);
|
|
|
+ }
|
|
|
+
|
|
|
$mtOrder = MtOrderClass::add($data);
|
|
|
return Json::encode(['data' => 'ok']);
|
|
|
-
|
|
|
- $app = new Application($this->config);
|
|
|
-
|
|
|
- $params = ['order_id' => '27061900338318741', 'is_mt_logistics' => 1];
|
|
|
- $orderDetail = $app->order->getOrderDetail($params);
|
|
|
- print_r(json_decode($orderDetail, true));
|
|
|
-
|
|
|
- // 商品类、活动类接口支持异步队列
|
|
|
- $app->goods->async()->create([]);
|
|
|
}
|
|
|
|
|
|
public function actionCancelOrder()
|
|
|
@@ -56,11 +54,18 @@ class MtController extends PublicController
|
|
|
if(!empty($post)) {
|
|
|
Yii::warning('cancelOrder: ' . urldecode(json_encode($post)));
|
|
|
}
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- if(!empty($get)) {
|
|
|
- Yii::warning('cancelOrder: ' . json_encode($get));
|
|
|
- }
|
|
|
|
|
|
return Json::encode(['data' => 'ok']);
|
|
|
}
|
|
|
+
|
|
|
+ public function demo() {
|
|
|
+ $app = new Application($this->config);
|
|
|
+
|
|
|
+ $params = ['order_id' => '27061900338318741', 'is_mt_logistics' => 1];
|
|
|
+ $orderDetail = $app->order->getOrderDetail($params);
|
|
|
+ print_r(json_decode($orderDetail, true));
|
|
|
+
|
|
|
+ // 商品类、活动类接口支持异步队列
|
|
|
+ $app->goods->async()->create([]);
|
|
|
+ }
|
|
|
}
|