Commit b03c2e95 authored by clone's avatar clone

Merge branch '0308-3.1.2' of https://gitee.com/zwyjjc/tl_estate into 0308-3.1.2

parents daef6de1 b202a44f
......@@ -125,7 +125,7 @@ class CouponService{
*
* @param int $user_id
* @param int $type
* @param $order_id
* @param $invitee_id
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
......@@ -147,12 +147,20 @@ class CouponService{
if ($type == 0) {
$count_where['invitee_id'] = $invitee_id;
$num = $this->m_coupon->getCount($count_where);
$num = $this->m_coupon->getCount($count_where); //是否邀请过该客户
if ($num > 0) {
continue;
}
}
$where['user_id'] = $user_id;
$where['activity_id'] = $v['id'];
$where['status'] = ['<>',2];
$num = $this->m_coupon->getCount($where);
if ($num <= $v['available']) {
continue;
}
if (strtotime($v['activity_start_time']) < $time && strtotime($v['activity_end_time']) > $time) {
$return_activity[] = $v;
}
......
......@@ -41,7 +41,7 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
e.stopPropagation();
redEnvelope.submitAdd();
});
//
//兑现动作
$("input[name='return_action']").change(function(){
var _this = $(this);
if(_this.val() == 0){
......@@ -51,7 +51,27 @@ define (['doT', 'text!temp/red_envelope_list_template_tpl.html', 'css!style/home
}
});
//奖励有效期
$("input[name='award-period']").change(function(){
var _this = $(this);
if(_this.val() == -1){
$('#activity-day').val(0);
}
});
//活动发放总次数
$("input[name='activity-total']").change(function(){
var _this = $(this);
if(_this.val() == -1){
$('#activity-total-num').val(0);
}
});
//用户可得红包数
$("input[name='activity-total-bag").change(function(){
var _this = $(this);
if(_this.val() == -1){
$('#activity-bag-num').val(0);
}
});
},
......
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