Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
1ac59181
Commit
1ac59181
authored
Dec 18, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VIP加入会员卡
parent
ec87e7f1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
16 deletions
+25
-16
application/admin/controller/Project.php
+1
-11
application/admin/controller/User.php
+5
-0
application/admin/view/user/index.html
+6
-0
application/api/controller/User.php
+13
-5
No files found.
application/admin/controller/Project.php
View file @
1ac59181
...
@@ -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
);
}
}
}
// 预约管理
// 预约管理
...
...
application/admin/controller/User.php
View file @
1ac59181
...
@@ -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
();
...
...
application/admin/view/user/index.html
View file @
1ac59181
...
@@ -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>
...
...
application/api/controller/User.php
View file @
1ac59181
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment