Commit 8f058a82 authored by liuyuzhen's avatar liuyuzhen

优惠券问题

parent 4109360f
......@@ -90,6 +90,8 @@ class CouponServiceModel extends \Business\AbstractModel{
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyCouponId);
}
$coupon = $couponDao->findById($where['couponId']);
$coupon['cash_money'] = $coupon['cash_money']?($coupon['cash_money']/\Our\ApiConst::hundred):\Our\ApiConst::zero;
$coupon['order_amount'] = $coupon['order_amount']?($coupon['order_amount']/\Our\ApiConst::hundred):\Our\ApiConst::zero;
if(!$coupon || $coupon['is_del'] == 1 || time() > $coupon['end_time'] || time() < $coupon['start_time']){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::couponNotExist);
}
......
......@@ -60,7 +60,7 @@ class StoreMemberModel extends \DAO\AbstractModel{
foreach($datas as $key => $data){
$sql .=\Our\Common::format(" (store_id={0} and member_id = {1} and type={2} ),",$data['storeId'],$data['memberId'],$data['type']);
}
$sql = substr($sql,0,strlen($sql)-1);
$sql = trim($sql,',');
$sql .= ";";
$res = $this->db->insert($this->_tableName)->query($sql);
return $res;
......
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