|
|
@@ -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);
|
|
|
+// }
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 确认订单
|
|
|
*/
|