Commit a9ef5176 by LiuJunYi

会员限购

parent 1fac3f16
......@@ -608,6 +608,7 @@ class Project extends AuthBase
unset($data['kf_qrcode']);
} else {
unset($data['sign_limits']);
unset($data['vip_limits']);
unset($data['time_period']);
unset($data['sign_endtime']);
}
......@@ -666,4 +667,4 @@ class Project extends AuthBase
}
}
\ No newline at end of file
}
......@@ -131,6 +131,14 @@
</div>
</div>
<div class="form-group type_toggle type-activity">
<label class="col-sm-2 control-label text-right">会员限购</label>
<div class="col-sm-10 col-md-8 col-lg-6">
<input type="number" class="form-control validate[required,custom[number]]" name="vip_limits"
value="{$info['vip_limits']??'';}" placeholder="会员限购">
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="col-sm-2 control-label text-right">城市</label>-->
<!--<div class="col-sm-10 col-md-8 col-lg-6">-->
......
......@@ -419,7 +419,18 @@ class Project extends Base
}
// 是否收藏了本活动
$project['is_collect'] = UserCollectionModel::get(['uid' => $this->userinfo[0], 'pid' => input('post.id')]) ? true : false;
$project['buy_vip_limits'] = 0;
$user = \app\common\model\User::get($this->userinfo[0]);
$project['is_vip'] = $user['is_vip'];
if($project['type'] == 1){
//会员限购
$project['buy_vip_limits'] = \app\common\model\Order::where([
'uid'=>$this->userinfo[0],
'pid'=>$project['id'],
'status'=>['in','1,2,3'],
'is_refund'=>['neq',3]
])->count('id');
}
return ['code' => 0, 'msg' => 'success', 'data' => $project];
}
......@@ -503,4 +514,4 @@ class Project extends Base
array_unshift($list, ['id' => 0, 'title' => '全部',"level"=>0]);
return ['code' => 1, 'msg' => 'success', 'data' => $list];
}
}
\ No newline at end of file
}
......@@ -115,7 +115,7 @@ class Project extends BaseModel
}
return config('domain_ssl') . $value;
}
//三级分类,城市
public function level1()
{
......@@ -133,4 +133,6 @@ class Project extends BaseModel
{
return $this->belongsTo('Region','level_3','id');
}
}
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