Commit 5859adc8 authored by zhuwei's avatar zhuwei

1

parent 0a86220b
......@@ -70,11 +70,13 @@ class ConvertCouponService
// 根据$user_id 取出 当前客户的 0首次登陆 1邀请登陆 券
$coupon_list = $this->getCoupon($user_id,'');
big_log('1'.json_encode($coupon_list));
if(!$coupon_list){
return false;
}
//去除已经过期的优惠券
$coupon_list = $this->filterExpireData($coupon_list);
big_log('2'.json_encode($coupon_list));
// 存在未过期 券数等于1直接核销
$coupon_list_count = count($coupon_list);
......@@ -84,10 +86,13 @@ class ConvertCouponService
}elseif($coupon_list_count > 1){
// 券数大于1 选取金额最大的核销
$coupon_list_new = $this->getMaxCoupon($coupon_list);
big_log('3'.json_encode($coupon_list));
$coupon_list = [];
$coupon_list[] = $coupon_list_new;
big_log('4'.json_encode($coupon_list));
}
big_log('5'.json_encode($coupon_list));
big_log('6'.json_encode($coupon_list[0]['id']));
//修改券状态为已使用
$this->m_coupon->updateUseStatus($coupon_list[0]['id'],1,$report_id,$bargain_id,$order_id,date("Y-m-d H:i:s", time()));
......@@ -213,7 +218,7 @@ class ConvertCouponService
//查找邀请人的信息
$referrer_res = $this->getUserInfo($user_id);
if (!$referrer_res){
big_log('查询到邀请人');
big_log('查询到邀请人');
return false;
}
// 存在邀请人则判断是否是客户
......
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