|
@@ -18,7 +18,16 @@ class ReductionActivity extends Model
|
|
|
// 获取订单金额满减数量
|
|
|
public static function getReduction($money,$act_set)
|
|
|
{
|
|
|
- if(empty($act_set)) return 0;
|
|
|
- array_multisort(array_column($act_set,'full'),$act_set);
|
|
|
+ $redu_money = 0;
|
|
|
+ if(empty($act_set)) return $redu_money;
|
|
|
+ array_multisort(array_column($act_set,'full'),SORT_DESC,$act_set);
|
|
|
+ foreach ($act_set as $tv)
|
|
|
+ {
|
|
|
+ if($money > $tv['full']){
|
|
|
+ $redu_money = $tv['reduction'];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $redu_money;
|
|
|
}
|
|
|
}
|