Ver Fonte

备份代码

frank há 3 anos atrás
pai
commit
19933904e2
1 ficheiros alterados com 28 adições e 0 exclusões
  1. 28 0
      frontendApi/modules/v1/controllers/ShopController.php

+ 28 - 0
frontendApi/modules/v1/controllers/ShopController.php

@@ -97,6 +97,34 @@ class ShopController extends BaseController {
         return static::notice(['payList'=>$payList,'allAddress'=>$allAddress,'userBalance'=>$userBalance]);
     }
 
+    /** todo 我要开发的部分
+     * 提交订单之前的显示正确的折扣信息
+     */
+    public function actionHandleOrderDiscountInfo()
+    {
+//        if (\Yii::$app->request->isPost) {
+//            $post = \Yii::$app->request->post();
+//
+//            if ($goods['TYPE'] == 1 || $goods['TYPE'] == 2) {
+//                $discount = $goodsType[$goods['TYPE']]['discount'];
+//                $realPrice = $goods['SELL_PRICE'] * $discount/100;
+//                $realPv = $goods['PRICE_PV'] * $discount/100;
+//            } else {
+//                $discount = $goods['SELL_DISCOUNT'];
+//                $realPrice = $goods['SELL_PRICE'] * $discount;
+//                $realPv = $goods['PRICE_PV'] * $discount;
+//            }
+//            $totalAmount += $realPrice * intval($v);
+//            $totalPv += $realPv * intval($v);
+
+//            if ($formModel->load($post, '') && $formModel->add()) {
+//                return static::notice('购物成功');
+//            } else {
+//                return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
+//            }
+//       }
+    }
+
     /**
      * 确认订单
      */