|
|
@@ -24,7 +24,7 @@ use common\components\util;
|
|
|
|
|
|
class OrderController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//商城下单操作 shish 2019.12.3
|
|
|
public function actionCreateOrder()
|
|
|
{
|
|
|
@@ -157,7 +157,7 @@ class OrderController extends BaseController
|
|
|
xhPayToolService::balancePay($orderSn, $totalFee, $capitalType, $couponId);
|
|
|
util::success('支付成功');
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//获取商城下单要用的微信支付和小程序支付参数 shish 2019.21.3
|
|
|
public function actionWxPay()
|
|
|
{
|
|
|
@@ -172,11 +172,11 @@ class OrderController extends BaseController
|
|
|
|
|
|
$name = isset($order['orderName']) && !empty($order['orderName']) ? $order['orderName'] : '购买商品';
|
|
|
$totalFee = $order['actPrice'];
|
|
|
-
|
|
|
+
|
|
|
//小程序使用miniOpenId
|
|
|
- if(httpUtil::isMiniProgram()){
|
|
|
+ if (httpUtil::isMiniProgram()) {
|
|
|
$openId = $this->user['miniOpenId'];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$openId = $this->user['openId'];
|
|
|
}
|
|
|
|
|
|
@@ -210,10 +210,10 @@ class OrderController extends BaseController
|
|
|
$input->SetOpenid($openId);
|
|
|
}
|
|
|
//小程序使用miniAppId
|
|
|
- if(httpUtil::isMiniProgram()){
|
|
|
+ if (httpUtil::isMiniProgram()) {
|
|
|
$merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
|
|
|
$tools = new \JsApiPay();
|
|
|
$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
|
|
|
@@ -269,14 +269,14 @@ class OrderController extends BaseController
|
|
|
$totalFee = $actPrice;
|
|
|
$userId = $post['userId'];
|
|
|
$user = UserService::getById($this->userId);
|
|
|
-
|
|
|
+
|
|
|
//小程序使用miniOpenId
|
|
|
- if(httpUtil::isMiniProgram()){
|
|
|
+ if (httpUtil::isMiniProgram()) {
|
|
|
$openId = $user['miniOpenId'];
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$openId = $user['openId'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$typeList = configDict::getConfig('capitalType');
|
|
|
$capitalType = $typeList['xhOrder']['id'];
|
|
|
$attach = 'capitalType=' . $capitalType . '&couponId=' . $couponId;//将流水类型、优惠卷传过去
|
|
|
@@ -292,7 +292,7 @@ class OrderController extends BaseController
|
|
|
$input->SetTime_expire(date("YmdHis", $expireTime));//设置订单有效期5分钟
|
|
|
$input->SetNotify_url($this->frontUrl . '/notice/weixin-callback/');
|
|
|
$input->SetTrade_type("JSAPI");
|
|
|
-
|
|
|
+
|
|
|
//花卉宝代为申请的微信支付
|
|
|
$merchantExtend = $this->merchantExtend;
|
|
|
if ($merchantExtend['generalMerchant'] == 1) {
|
|
|
@@ -301,10 +301,10 @@ class OrderController extends BaseController
|
|
|
$input->SetOpenid($openId);
|
|
|
}
|
|
|
//小程序使用miniAppId
|
|
|
- if(httpUtil::isMiniProgram()){
|
|
|
+ if (httpUtil::isMiniProgram()) {
|
|
|
$merchantExtend['wxAppId'] = $merchantExtend['miniAppId'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$wxOrder = \WxPayApi::unifiedOrder($input, 6, $merchantExtend);
|
|
|
$tools = new \JsApiPay();
|
|
|
$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $merchantExtend);
|
|
|
@@ -422,5 +422,14 @@ class OrderController extends BaseController
|
|
|
OrderService::comment($post);
|
|
|
util::ok('提交成功');
|
|
|
}
|
|
|
+
|
|
|
+ //订单详情 shish 2019.12.16
|
|
|
+ public function actionDetail()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->get('id');
|
|
|
+ $detail = OrderService::getOrderById($id);
|
|
|
+ OrderService::valid($detail, $this->merchantId);
|
|
|
+ util::success($detail);
|
|
|
+ }
|
|
|
|
|
|
}
|