Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
ebab6543
Commit
ebab6543
authored
Dec 19, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户编辑
parent
ed864f56
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
11 deletions
+56
-11
Member.php
application/index/controller/Member.php
+8
-6
users_list.html
application/index/view/member/users_list.html
+5
-4
user.js
public/resource/js/user.js
+42
-0
user_template_tpl.html
public/resource/template/user_template_tpl.html
+1
-1
No files found.
application/index/controller/Member.php
View file @
ebab6543
...
@@ -35,23 +35,25 @@ class Member extends Basic{
...
@@ -35,23 +35,25 @@ class Member extends Basic{
$where
[
'status'
]
=
0
;
$where
[
'status'
]
=
0
;
if
(
$params
[
'name'
]
)
{
if
(
isset
(
$params
[
'name'
])
)
{
$where
[
'a.user_nick'
]
=
[
'like'
,
'%'
.
$params
[
'name'
]
.
'%'
];
$where
[
'a.user_nick'
]
=
[
'like'
,
'%'
.
$params
[
'name'
]
.
'%'
];
}
}
if
(
$params
[
'phone'
]
)
{
if
(
isset
(
$params
[
'phone'
])
)
{
$where
[
'a.user_phone'
]
=
[
'like'
,
'%'
.
$params
[
'phone'
]
.
'%'
];
$where
[
'a.user_phone'
]
=
[
'like'
,
'%'
.
$params
[
'phone'
]
.
'%'
];
}
}
if
(
$params
[
'invite'
]
)
{
if
(
isset
(
$params
[
'invite'
])
)
{
$where
[
'b.phone'
]
=
[
'like'
,
'%'
.
$params
[
'invite'
]
.
'%'
];
$where
[
'b.phone'
]
=
[
'like'
,
'%'
.
$params
[
'invite'
]
.
'%'
];
}
}
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,b.realname'
;
if
(
isset
(
$params
[
'id'
]))
{
$where
[
'a.id'
]
=
$params
[
'id'
];
}
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,b.realname,b.phone,a.user_pswd'
;
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
''
,
$fields
,
$where
);
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
''
,
$fields
,
$where
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
);
$data
[
'pageNo'
]
=
$pageNo
;
$data
[
'pageSize'
]
=
$pageSize
;
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
}
}
...
...
application/index/view/member/users_list.html
View file @
ebab6543
...
@@ -129,7 +129,8 @@
...
@@ -129,7 +129,8 @@
</h4>
</h4>
</div>
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<form
class=
"form-horizontal"
action=
"/adminAgents/update_agent_level02456"
method=
"post"
onsubmit=
"return check2()"
>
<input
type=
"hidden"
id=
"edit_id"
>
<form
class=
"form-horizontal"
id=
"edit_user_form"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
手机(登录账号):
</label>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
手机(登录账号):
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
...
@@ -146,14 +147,14 @@
...
@@ -146,14 +147,14 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
邀请人姓名:
</label>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
邀请人姓名:
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<span
class=
"use-span1"
>
(选填)
</span>
<span
class=
"use-span1"
id=
"invite_name"
>
</span>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
邀请人手机:
</label>
<label
for=
"inputPassword3"
class=
"col-sm-3 control-label"
>
邀请人手机:
</label>
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<span
class=
"use-span1"
>
dsdaad填)
</span>
<span
class=
"use-span1"
>
</span>
</div>
</div>
</div>
</div>
...
@@ -162,7 +163,7 @@
...
@@ -162,7 +163,7 @@
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
</button>
<button
type=
"button"
class=
"btn btn-primary"
>
<button
type=
"button"
class=
"btn btn-primary"
id=
"edit_user"
>
提交
提交
</button>
</button>
</div>
</div>
...
...
public/resource/js/user.js
View file @
ebab6543
...
@@ -45,6 +45,15 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -45,6 +45,15 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
user
.
delete_user
(
params
);
user
.
delete_user
(
params
);
});
});
$
(
"#edit_user"
).
click
(
function
()
{
var
params
=
{};
params
.
id
=
$
(
"#edit_id"
).
val
();
params
.
type
=
'eidt'
;
params
.
realname
=
$
(
"#edit_user_form input[name='phone']"
).
val
();
params
.
pwd
=
$
(
"#edit_user_form input[name='password']"
).
val
();
user
.
edit_user
(
params
);
});
},
},
getList
:
function
(
pageNo
)
{
getList
:
function
(
pageNo
)
{
user
.
pageNo
=
pageNo
;
user
.
pageNo
=
pageNo
;
...
@@ -116,6 +125,18 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -116,6 +125,18 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
}
}
});
});
},
},
edit_user
:
function
(
params
)
{
$
.
ajax
({
url
:
'/index/user_add'
,
type
:
'POST'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
console
.
log
(
data
);
}
});
},
delete_user
:
function
(
params
)
{
delete_user
:
function
(
params
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/index/del_user'
,
url
:
'/index/del_user'
,
...
@@ -139,4 +160,24 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -139,4 +160,24 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
function
delete_user
(
obj
)
{
function
delete_user
(
obj
)
{
$
(
"#delete_id"
).
val
(
$
(
obj
).
attr
(
"data-id"
));
$
(
"#delete_id"
).
val
(
$
(
obj
).
attr
(
"data-id"
));
}
function
edit
(
obj
)
{
var
params
=
{}
params
.
id
=
$
(
obj
).
attr
(
"data-id"
)
$
.
ajax
({
url
:
'/index/usersList'
,
type
:
'get'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
$
(
"#edit_user_form input[name='phone']"
).
val
(
data
.
data
.
list
[
0
].
user_phone
);
$
(
"#edit_user_form input[name='password']"
).
val
(
data
.
data
.
list
[
0
].
user_pswd
);
$
(
"#invite_name"
).
html
(
data
.
data
.
list
[
0
].
realname
);
$
(
"#invite_phone"
).
html
(
data
.
data
.
list
[
0
].
phone
);
}
});
$
(
"#edit_id"
).
val
(
$
(
obj
).
attr
(
"data-id"
));
}
}
\ No newline at end of file
public/resource/template/user_template_tpl.html
View file @
ebab6543
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<
td
>
[
%=
it
[
item
][
"user_phone"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"user_phone"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"realname"
]
%
]
<
/td
>
<
td
>
[
%=
it
[
item
][
"realname"
]
%
]
<
/td
>
<
td
>
<
td
>
<
a
class
=
"btn1 btn-success "
href
=
"#modal-do"
data
-
toggle
=
"modal"
>
<
a
class
=
"btn1 btn-success "
href
=
"#modal-do"
data
-
toggle
=
"modal"
onclick
=
"edit(this)"
data
-
id
=
"[%= it[item]["
id
"] %]"
>
编辑
编辑
<
/a
>
<
/a
>
<
a
class
=
"btn1 btn-danger "
href
=
"#modal-delete"
data
-
toggle
=
"modal"
onclick
=
"delete_user(this)"
data
-
id
=
'[%= it[item]["id"] %]'
>
<
a
class
=
"btn1 btn-danger "
href
=
"#modal-delete"
data
-
toggle
=
"modal"
onclick
=
"delete_user(this)"
data
-
id
=
'[%= it[item]["id"] %]'
>
...
...
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