Commit 155e52fd authored by liuyuzhen's avatar liuyuzhen

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

parent 1ce8d20a
File mode changed from 100755 to 100644
......@@ -243,6 +243,9 @@ class OrderConfirmUtil {
}
$reliefAmount = isset($tempStore['reliefAmount'])?$tempStore['reliefAmount']:\Our\ApiConst::zero;
$orderAmount = $tempStore['storeTotalPrice'] - $reliefAmount + $deliveryFee;
if($orderAmount<=\Our\ApiConst::zero){
$orderAmount = \Our\ApiConst::zero;
}
if($orderAmount!=$requestData['totalFee']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::wrongTotalFeeForOrder);
}
......
......@@ -724,6 +724,8 @@ class CartServiceModel extends \Business\AbstractModel{
$couponDao = \DAO\Coupon\CouponModel::getInstance();
$couponList = array();
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);
if($reliefAmount!==false){
$coupon['couponId'] = $tempCoupon['couponId'];
......
......@@ -23,8 +23,8 @@ class CouponModel extends \DAO\AbstractModel {
*/
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 $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 $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,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(){
......@@ -221,8 +221,8 @@ class CouponModel extends \DAO\AbstractModel {
return $coupons;
}
public function getCartCouponTitles($where){
$coupons = $this->getList($where,$this->availCartStoreIndexField);
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,$field);
if($coupons){
$result = array();
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