Commit 1ac59181 by LiuJunYi

VIP加入会员卡

parent ec87e7f1
...@@ -296,17 +296,7 @@ class Project extends AuthBase ...@@ -296,17 +296,7 @@ class Project extends AuthBase
//删除标签 //删除标签
public function deleteTag() public function deleteTag()
{ {
$id = input('post.id'); //查询
$used = $this->project_model->where('tags', 'like', "%" . '|' . $id . '|' . "%")->count();
if ($used > 0) {
$this->error('该标签已在项目中引用,不可删除!', '', '', 1);
}
$res = model('tags')->destroy($id);
if ($res) {
$this->success('删除成功', '', '', 1);
} else {
$this->error('删除失败', '', '', 1);
}
} }
// 预约管理 // 预约管理
......
...@@ -45,6 +45,11 @@ class User extends AuthBase ...@@ -45,6 +45,11 @@ class User extends AuthBase
$user_model = model('user'); $user_model = model('user');
$user_list = $user_model->where($condition)->order('created_at desc') $user_list = $user_model->where($condition)->order('created_at desc')
->paginate(10,['query'=>['nickname'=>$nickname,'is_vip'=>$is_vip,'start_time'=>$start_time,'end_time'=>$end_time,'phone'=>$phone]]); ->paginate(10,['query'=>['nickname'=>$nickname,'is_vip'=>$is_vip,'start_time'=>$start_time,'end_time'=>$end_time,'phone'=>$phone]]);
//把编号字符串分割
foreach($user_list as &$v){
$numberArr = str_split($v['vip_number'], 4);
$v['vip_number'] = implode(' ', $numberArr);
}
$this->assign('user_list',$user_list); $this->assign('user_list',$user_list);
return $this->fetch(); return $this->fetch();
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
<th>联系方式</th> <th>联系方式</th>
<th>所在地</th> <th>所在地</th>
<th>会员</th> <th>会员</th>
<th>会员卡号</th>
<th>微信号</th> <th>微信号</th>
<th>地址</th> <th>地址</th>
<th>会员到期时间</th> <th>会员到期时间</th>
...@@ -87,6 +88,11 @@ ...@@ -87,6 +88,11 @@
非会员 非会员
{/if} {/if}
</td> </td>
<td>
{if condition="$vo.is_vip == 1"}
{$vo.vip_number}
{/if}
</td>
<td>{$vo.wx_number}</td> <td>{$vo.wx_number}</td>
<td>{$vo.address}</td> <td>{$vo.address}</td>
<td> <td>
......
...@@ -152,7 +152,7 @@ class User extends Base ...@@ -152,7 +152,7 @@ class User extends Base
$result = ['phone' => $phone, 'hidephone' => $hidephone]; $result = ['phone' => $phone, 'hidephone' => $hidephone];
//关联VIP //关联VIP
$is_relation = $this->vipRelation($phone); $is_relation = $this->vipRelation($phone);
return ["code" => 0, "msg" => "获取成功", 'data' => $result,'is_relation'=>$is_relation]; return ["code" => 0, "msg" => "获取成功", 'data' => $result, 'is_relation' => $is_relation];
} else { } else {
return ["code" => 1, "msg" => "微信数据解密失败,请重试!"]; return ["code" => 1, "msg" => "微信数据解密失败,请重试!"];
} }
...@@ -168,9 +168,9 @@ class User extends Base ...@@ -168,9 +168,9 @@ class User extends Base
UserModel::where('phone', $phone)->update([ UserModel::where('phone', $phone)->update([
'is_vip' => 1, 'is_vip' => 1,
'vip_endtime' => $relation['vip_expire'], 'vip_endtime' => $relation['vip_expire'],
'name'=>$relation['nickname'], 'name' => $relation['nickname'],
'address'=>$relation['address'], 'address' => $relation['address'],
'wx_number'=>$relation['wx_number'], 'wx_number' => $relation['wx_number'],
]); ]);
$relation->is_relation = 1; $relation->is_relation = 1;
$relation->save(); $relation->save();
...@@ -196,10 +196,18 @@ class User extends Base ...@@ -196,10 +196,18 @@ class User extends Base
$user['vip_endtime_str'] = ''; $user['vip_endtime_str'] = '';
} }
$user['hidephone'] = substr_replace($user['phone'], '****', 3, 4); $user['hidephone'] = substr_replace($user['phone'], '****', 3, 4);
//查询是否存在编号
if (empty($user['vip_number'])) {
UserModel::where('id', $user['id'])->update(['vip_number' => 'MXZ' . base_convert(uniqid(), 16, 10)]);
$user['vip_number'] = 'MXZ' . base_convert(uniqid(), 16, 10);
halt($user);
}
//把编号字符串分割
$numberArr = str_split($user['vip_number'], 4);
$user['vip_number'] = implode(' ', $numberArr);
return ['code' => 0, 'msg' => 'success', 'data' => $user]; return ['code' => 0, 'msg' => 'success', 'data' => $user];
} }
/** /**
* 更新用户 * 更新用户
* @url /api/User/update * @url /api/User/update
......
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