|
@@ -23,13 +23,13 @@ class OrderController extends BaseController
|
|
|
//商城下单操作 shish 2019.12.3
|
|
//商城下单操作 shish 2019.12.3
|
|
|
public function actionCreateOrder()
|
|
public function actionCreateOrder()
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//给出省市区的接口 todo
|
|
//给出省市区的接口 todo
|
|
|
//给出商家门店地址接口 todo
|
|
//给出商家门店地址接口 todo
|
|
|
//给出腾讯的接口 todo
|
|
//给出腾讯的接口 todo
|
|
|
//运费 计算方式 todo
|
|
//运费 计算方式 todo
|
|
|
//余额支付 要使用哪个接口 todo
|
|
//余额支付 要使用哪个接口 todo
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$post = Yii::$app->request->post();
|
|
$post = Yii::$app->request->post();
|
|
|
$goodsId = isset($post['goodsId']) ? $post['goodsId'] : 0;
|
|
$goodsId = isset($post['goodsId']) ? $post['goodsId'] : 0;
|
|
|
$goodsStyleId = isset($post['goodsStyleId']) ? $post['goodsStyleId'] : 0;
|
|
$goodsStyleId = isset($post['goodsStyleId']) ? $post['goodsStyleId'] : 0;
|
|
@@ -135,7 +135,7 @@ class OrderController extends BaseController
|
|
|
$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
|
|
$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
|
|
|
$orderId = isset($post['orderId']) ? $post['orderId'] : 0;
|
|
$orderId = isset($post['orderId']) ? $post['orderId'] : 0;
|
|
|
$order = OrderService::getById($orderId);
|
|
$order = OrderService::getById($orderId);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//验证订单有效性
|
|
//验证订单有效性
|
|
|
OrderService::valid($order, $this->userId);
|
|
OrderService::valid($order, $this->userId);
|
|
|
|
|
|
|
@@ -145,10 +145,13 @@ class OrderController extends BaseController
|
|
|
$typeList = configDict::getConfig('capitalType');
|
|
$typeList = configDict::getConfig('capitalType');
|
|
|
$capitalType = $typeList['xhOrder']['id'];
|
|
$capitalType = $typeList['xhOrder']['id'];
|
|
|
$attach = "couponId=" . $couponId . "&capitalType=" . $capitalType;//将流水类型、代金劵传过去
|
|
$attach = "couponId=" . $couponId . "&capitalType=" . $capitalType;//将流水类型、代金劵传过去
|
|
|
-
|
|
|
|
|
- $weixin = Yii::getAlias("@vendor/weixin");
|
|
|
|
|
- require_once($weixin . '/lib/WxPay.Api.php');
|
|
|
|
|
- require_once($weixin . '/example/WxPay.JsApiPay.php');
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $now = time();
|
|
|
|
|
+ $expireTime = $now + 1800;//订单30分钟后过期
|
|
|
|
|
+
|
|
|
|
|
+ $wx = Yii::getAlias("@vendor/weixin");
|
|
|
|
|
+ require_once($wx . '/lib/WxPay.Api.php');
|
|
|
|
|
+ require_once($wx . '/example/WxPay.JsApiPay.php');
|
|
|
$input = new \WxPayUnifiedOrder();
|
|
$input = new \WxPayUnifiedOrder();
|
|
|
$input->SetBody($name);
|
|
$input->SetBody($name);
|
|
|
$input->SetOut_trade_no($orderId);
|
|
$input->SetOut_trade_no($orderId);
|
|
@@ -180,7 +183,7 @@ class OrderController extends BaseController
|
|
|
OrderService::updateById($orderId, $updateData);
|
|
OrderService::updateById($orderId, $updateData);
|
|
|
util::success($newParams);
|
|
util::success($newParams);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//快速付款订单
|
|
//快速付款订单
|
|
|
public function actionFastWxPay()
|
|
public function actionFastWxPay()
|
|
|
{
|
|
{
|
|
@@ -279,9 +282,9 @@ class OrderController extends BaseController
|
|
|
$typeList = configDict::getConfig('capitalType');
|
|
$typeList = configDict::getConfig('capitalType');
|
|
|
$capitalType = $typeList['xhOrder']['id'];
|
|
$capitalType = $typeList['xhOrder']['id'];
|
|
|
$attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId;//将流水类型、优惠卷传过去
|
|
$attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId;//将流水类型、优惠卷传过去
|
|
|
- $weixin = Yii::getAlias("@vendor/weixin");
|
|
|
|
|
- require_once($weixin . '/lib/WxPay.Api.php');
|
|
|
|
|
- require_once($weixin . '/example/WxPay.JsApiPay.php');
|
|
|
|
|
|
|
+ $wx = Yii::getAlias("@vendor/weixin");
|
|
|
|
|
+ require_once($wx . '/lib/WxPay.Api.php');
|
|
|
|
|
+ require_once($wx . '/example/WxPay.JsApiPay.php');
|
|
|
$input = new \WxPayUnifiedOrder();
|
|
$input = new \WxPayUnifiedOrder();
|
|
|
$input->SetBody($name);
|
|
$input->SetBody($name);
|
|
|
$input->SetOut_trade_no($orderId);
|
|
$input->SetOut_trade_no($orderId);
|
|
@@ -311,7 +314,7 @@ class OrderController extends BaseController
|
|
|
}
|
|
}
|
|
|
util::success(['orderId' => $orderId]);
|
|
util::success(['orderId' => $orderId]);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//快捷支付使用支付宝付款 shish 2019.12.3
|
|
//快捷支付使用支付宝付款 shish 2019.12.3
|
|
|
public function actionFastZfbPay()
|
|
public function actionFastZfbPay()
|
|
|
{
|
|
{
|