Commit 155e52fd authored by liuyuzhen's avatar liuyuzhen

下单金额为0问题和优惠券显示为元的问题

parent 1ce8d20a
File mode changed from 100755 to 100644
...@@ -243,6 +243,9 @@ class OrderConfirmUtil { ...@@ -243,6 +243,9 @@ class OrderConfirmUtil {
} }
$reliefAmount = isset($tempStore['reliefAmount'])?$tempStore['reliefAmount']:\Our\ApiConst::zero; $reliefAmount = isset($tempStore['reliefAmount'])?$tempStore['reliefAmount']:\Our\ApiConst::zero;
$orderAmount = $tempStore['storeTotalPrice'] - $reliefAmount + $deliveryFee; $orderAmount = $tempStore['storeTotalPrice'] - $reliefAmount + $deliveryFee;
if($orderAmount<=\Our\ApiConst::zero){
$orderAmount = \Our\ApiConst::zero;
}
if($orderAmount!=$requestData['totalFee']){ if($orderAmount!=$requestData['totalFee']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder); \Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
} }
......
...@@ -724,6 +724,8 @@ class CartServiceModel extends \Business\AbstractModel{ ...@@ -724,6 +724,8 @@ class CartServiceModel extends \Business\AbstractModel{
$couponDao = \DAO\Coupon\CouponModel::getInstance(); $couponDao = \DAO\Coupon\CouponModel::getInstance();
$couponList = array(); $couponList = array();
foreach($tempCoupons as $tempCoupon){ foreach($tempCoupons as $tempCoupon){
$tempCoupon['cash_money'] = $tempCoupon['cash_money']*\Our\ApiConst::hundred;
$tempCoupon['order_amount'] = $tempCoupon['order_amount']*\Our\ApiConst::hundred;
$reliefAmount = $this->getOneCouponReliefAmount($tempCoupon,$storeCarts); $reliefAmount = $this->getOneCouponReliefAmount($tempCoupon,$storeCarts);
if($reliefAmount!==false){ if($reliefAmount!==false){
$coupon['couponId'] = $tempCoupon['couponId']; $coupon['couponId'] = $tempCoupon['couponId'];
......
...@@ -23,8 +23,8 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -23,8 +23,8 @@ class CouponModel extends \DAO\AbstractModel {
*/ */
protected $_primaryKey = 'id'; protected $_primaryKey = 'id';
protected $availStoreIndexField = 'id,type,cash_money,order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id'; protected $availStoreIndexField = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id';
protected $availCartStoreIndexField = 'id,type,cash_money,order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids'; protected $availCartStoreIndexField = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids';
public function init(){ public function init(){
...@@ -221,8 +221,8 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -221,8 +221,8 @@ class CouponModel extends \DAO\AbstractModel {
return $coupons; return $coupons;
} }
public function getCartCouponTitles($where){ public function getCartCouponTitles($where,$field = 'id,type,FORMAT(cash_money/100,2) as cash_money,FORMAT(order_amount/100,2) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,ids,gift_coupon_id,gift_goods_ids'){
$coupons = $this->getList($where,$this->availCartStoreIndexField); $coupons = $this->getList($where,$field);
if($coupons){ if($coupons){
$result = array(); $result = array();
foreach($coupons as $coupon){ foreach($coupons as $coupon){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment