test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
919 B

<?php
defined('IN_IA') or exit('Access Denied');
class Fullreduce{
/**
* 根据订单金额返回满减金额
* @access static
* @name initSingleGoods
* @param $price 订单金额
* @param $id 满减活动id
* @return $money 返回减少金额
*/
static function getFullreduceMoney($price,$id){
global $_W;
$full = pdo_get('wlmerchant_fullreduce_list',array('id' => $id),array('rules','status'));
if($full['status']>0){
$rules = unserialize($full['rules']);
if(!empty($rules)){
foreach ($rules as $ru){
if($price >= $ru['full_money']){
$money = $ru['cut_money'];
break;
}
}
}
}
if($money<0 || empty($money)){
$money = 0;
}
return $money;
}
}