Commit 880947c9 authored by liuyuzhen's avatar liuyuzhen

优惠券问题

parent cfb7c0dd
...@@ -380,6 +380,7 @@ class CouponServiceModel extends \Business\AbstractModel{ ...@@ -380,6 +380,7 @@ class CouponServiceModel extends \Business\AbstractModel{
} }
unset($coupon['is_overlay']); unset($coupon['is_overlay']);
} }
var_dump($couponList);
return $couponList; return $couponList;
} }
......
...@@ -23,9 +23,9 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -23,9 +23,9 @@ class CouponModel extends \DAO\AbstractModel {
*/ */
protected $_primaryKey = 'id'; protected $_primaryKey = '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 $availStoreIndexField = 'id,type,ROUND(cash_money/100,0) as cash_money,ROUND(order_amount/100,0) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id';
protected $availTitleField = '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,ids'; protected $availTitleField = 'id,type,ROUND(cash_money/100,0) as cash_money,ROUND(order_amount/100,0) as order_amount,discount,store_id,coupon_type,is_overlay,start_time,end_time,gift_coupon_id,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'; protected $availCartStoreIndexField = 'id,type,ROUND(cash_money/100,0) as cash_money,ROUND(order_amount/100,0) 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(){
...@@ -223,7 +223,7 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -223,7 +223,7 @@ class CouponModel extends \DAO\AbstractModel {
return $coupons; return $coupons;
} }
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'){ public function getCartCouponTitles($where,$field = 'id,type,ROUND(cash_money/100,2) as cash_money,ROUND(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); $coupons = $this->getList($where,$field);
if($coupons){ if($coupons){
$result = array(); $result = array();
...@@ -233,9 +233,9 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -233,9 +233,9 @@ class CouponModel extends \DAO\AbstractModel {
$temp['type'] = $coupon['type']; $temp['type'] = $coupon['type'];
$temp['couponId'] = $coupon['id']; $temp['couponId'] = $coupon['id'];
$temp['store_id'] = $coupon['store_id']; $temp['store_id'] = $coupon['store_id'];
$temp['order_amount'] = $coupon['order_amount']; $temp['order_amount'] = intval($coupon['order_amount']);
$temp['discount'] = $coupon['discount']; $temp['discount'] = $coupon['discount'];
$temp['cash_money'] = $coupon['cash_money']; $temp['cash_money'] = intval($coupon['cash_money']);
$temp['ids'] = $coupon['ids']; $temp['ids'] = $coupon['ids'];
$temp['gift_coupon_id'] = isset($coupon['gift_coupon_id'])?$coupon['gift_coupon_id']:\Our\ApiConst::zero; $temp['gift_coupon_id'] = isset($coupon['gift_coupon_id'])?$coupon['gift_coupon_id']:\Our\ApiConst::zero;
$temp['gift_goods_ids'] = isset($coupon['gift_goods_ids'])?$coupon['gift_goods_ids']:\Our\NameConst::emptyString; $temp['gift_goods_ids'] = isset($coupon['gift_goods_ids'])?$coupon['gift_goods_ids']:\Our\NameConst::emptyString;
...@@ -272,7 +272,7 @@ class CouponModel extends \DAO\AbstractModel { ...@@ -272,7 +272,7 @@ class CouponModel extends \DAO\AbstractModel {
$temp['type'] = $coupon['coupon_type']; $temp['type'] = $coupon['coupon_type'];
$temp['couponId'] = $coupon['id']; $temp['couponId'] = $coupon['id'];
$temp['is_overlay'] = $coupon['is_overlay']; $temp['is_overlay'] = $coupon['is_overlay'];
$orderAmount = intval($coupon['order_amount']); $orderAmount = (int)$coupon['order_amount'];
if($coupon['type'] == \Our\ApiConst::noLimitCoupon){//无门槛优惠券 if($coupon['type'] == \Our\ApiConst::noLimitCoupon){//无门槛优惠券
$temp['type'] = \Our\ApiConst::noLimitCouponType; $temp['type'] = \Our\ApiConst::noLimitCouponType;
$temp['title'] = intval($coupon['cash_money']); $temp['title'] = intval($coupon['cash_money']);
......
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