Commit a9ef5176 by LiuJunYi

会员限购

parent 1fac3f16
...@@ -608,6 +608,7 @@ class Project extends AuthBase ...@@ -608,6 +608,7 @@ class Project extends AuthBase
unset($data['kf_qrcode']); unset($data['kf_qrcode']);
} else { } else {
unset($data['sign_limits']); unset($data['sign_limits']);
unset($data['vip_limits']);
unset($data['time_period']); unset($data['time_period']);
unset($data['sign_endtime']); unset($data['sign_endtime']);
} }
......
...@@ -131,6 +131,14 @@ ...@@ -131,6 +131,14 @@
</div> </div>
</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">--> <!--<div class="form-group">-->
<!--<label class="col-sm-2 control-label text-right">城市</label>--> <!--<label class="col-sm-2 control-label text-right">城市</label>-->
<!--<div class="col-sm-10 col-md-8 col-lg-6">--> <!--<div class="col-sm-10 col-md-8 col-lg-6">-->
......
...@@ -419,7 +419,18 @@ class Project extends Base ...@@ -419,7 +419,18 @@ class Project extends Base
} }
// 是否收藏了本活动 // 是否收藏了本活动
$project['is_collect'] = UserCollectionModel::get(['uid' => $this->userinfo[0], 'pid' => input('post.id')]) ? true : false; $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]; return ['code' => 0, 'msg' => 'success', 'data' => $project];
} }
......
...@@ -133,4 +133,6 @@ class Project extends BaseModel ...@@ -133,4 +133,6 @@ class Project extends BaseModel
{ {
return $this->belongsTo('Region','level_3','id'); 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