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
07d2bf03
Commit
07d2bf03
authored
Jul 11, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
特殊权限控制
parent
c4245052
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
26 deletions
+45
-26
Member.php
application/index/controller/Member.php
+17
-18
Basic.php
application/index/extend/Basic.php
+27
-7
route.php
application/route.php
+0
-1
user.js
public/resource/js/user.js
+1
-0
No files found.
application/index/controller/Member.php
View file @
07d2bf03
...
@@ -310,24 +310,8 @@ class Member extends Basic{
...
@@ -310,24 +310,8 @@ class Member extends Basic{
$data
=
[];
$data
=
[];
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
request
->
isPost
())
{
//编辑用户
//编辑用户
if
(
isset
(
$this
->
params
[
'id'
]))
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
$user_data
=
$this
->
user
->
getUserById
(
'id,agent_id'
,
$this
->
params
[
'id'
]);
if
(
empty
(
$user_data
))
{
return
$this
->
response
(
101
,
'没有用户信息'
);
}
else
{
//是否修改客方
if
(
$this
->
params
[
'agents_id'
]
!=
$user_data
[
'agent_id'
])
{
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'修改为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
else
{
$remark
=
'用户编辑'
;
}
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
//新增或编辑
}
}
else
{
//新增用户
//新增用户
$where
[
'user_phone'
]
=
$this
->
params
[
'user_phone'
];
$where
[
'user_phone'
]
=
$this
->
params
[
'user_phone'
];
$num
=
$this
->
user
->
all_user_count
(
$where
);
$num
=
$this
->
user
->
all_user_count
(
$where
);
...
@@ -338,12 +322,27 @@ class Member extends Basic{
...
@@ -338,12 +322,27 @@ class Member extends Basic{
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'新增为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$remark
=
'新增为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$result
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
//新增或编辑
$result
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
//新增或编辑
if
(
$result
==
-
1
)
{
if
(
$result
==
-
1
)
{
return
$this
->
response
(
101
,
'该用户已经存在!'
);
return
$this
->
response
(
101
,
'该用户已经存在!'
);
}
}
$this
->
params
[
'id'
]
=
$result
;
$this
->
params
[
'id'
]
=
$result
;
}
else
{
$user_data
=
$this
->
user
->
getUserById
(
'id,agent_id'
,
$this
->
params
[
'id'
]);
if
(
empty
(
$user_data
))
{
return
$this
->
response
(
101
,
'没有用户信息'
);
}
else
{
//是否修改客方
if
(
$this
->
params
[
'agents_id'
]
!=
$user_data
[
'agent_id'
])
{
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'修改为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
else
{
$remark
=
'用户编辑'
;
}
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
//新增或编辑
}
}
}
$this
->
operating_records
(
$this
->
userId
,
$type
=
3
,
$remark
,
$this
->
params
[
'id'
]);
$this
->
operating_records
(
$this
->
userId
,
$type
=
3
,
$remark
,
$this
->
params
[
'id'
]);
...
...
application/index/extend/Basic.php
View file @
07d2bf03
...
@@ -12,6 +12,7 @@ namespace app\index\extend;
...
@@ -12,6 +12,7 @@ namespace app\index\extend;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\GOperatingRecords
;
use
app\model\GOperatingRecords
;
use
app\model\Users
;
use
think\Controller
;
use
think\Controller
;
use
think\Request
;
use
think\Request
;
use
think\Response
;
use
think\Response
;
...
@@ -128,15 +129,34 @@ class Basic extends Controller
...
@@ -128,15 +129,34 @@ class Basic extends Controller
$is_auth
=
$agents
->
agentsAuth
(
$auth_id
,
$this
->
userId
);
$is_auth
=
$agents
->
agentsAuth
(
$auth_id
,
$this
->
userId
);
$is_auth
=
empty
(
$is_auth
[
'id'
])
?
0
:
1
;
$is_auth
=
empty
(
$is_auth
[
'id'
])
?
0
:
1
;
//处理盘方编辑商铺
if
(
$is_auth
==
0
)
{
if
(
$is_auth
==
0
)
{
//处理盘方编辑商铺
if
(
$requestPath
==
'index/houseEdit'
&&
isset
(
$this
->
params
[
'id'
]))
{
if
(
$requestPath
==
'index/houseEdit'
&&
isset
(
$this
->
params
[
'id'
]))
{
$agent
=
new
GHousesToAgents
();
$where
[
'houses_id'
]
=
$this
->
params
[
'id'
];
if
(
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'type'
]
=
2
;
$is_auth
=
1
;
$where
[
'agents_id'
]
=
$this
->
userId
;
}
else
{
$is_
=
$agent
->
getTotal
(
$where
);
$agent
=
new
GHousesToAgents
();
$is_auth
=
$is_
>
0
?
1
:
0
;
$where
[
'houses_id'
]
=
$this
->
params
[
'id'
];
$where
[
'type'
]
=
2
;
$where
[
'agents_id'
]
=
$this
->
userId
;
$is_
=
$agent
->
getTotal
(
$where
);
$is_auth
=
$is_
>
0
?
1
:
0
;
}
}
//处理客方编辑客户
if
(
$requestPath
==
'index/pcEditClient'
&&
isset
(
$this
->
params
[
'id'
]))
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
$is_auth
=
1
;
}
else
{
$m_user
=
new
Users
();
$where
[
'agent_id'
]
=
$this
->
userId
;
$where
[
'id'
]
=
$this
->
params
[
'id'
];
$is_
=
$m_user
->
getUserAgentTotal
(
$where
);
$is_auth
=
$is_
>
0
?
1
:
0
;
}
}
}
}
}
...
...
application/route.php
View file @
07d2bf03
...
@@ -74,7 +74,6 @@ Route::group('index', [
...
@@ -74,7 +74,6 @@ Route::group('index', [
//user列表
//user列表
'users_list'
=>
[
'index/member/getUserList'
,
[
'method'
=>
'get'
]
],
'users_list'
=>
[
'index/member/getUserList'
,
[
'method'
=>
'get'
]
],
'user_add'
=>
[
'index/member/user_add'
,
[
'method'
=>
'post'
]
],
'del_user'
=>
[
'index/member/delUser'
,
[
'method'
=>
'post'
]
],
'del_user'
=>
[
'index/member/delUser'
,
[
'method'
=>
'post'
]
],
'pcAddFollow'
=>
[
'index/member/pcAddFollow'
,
[
'method'
=>
'post'
]
],
'pcAddFollow'
=>
[
'index/member/pcAddFollow'
,
[
'method'
=>
'post'
]
],
'pcEditClient'
=>
[
'index/member/pcEditClient'
,
[
'method'
=>
'post | get'
]
],
'pcEditClient'
=>
[
'index/member/pcEditClient'
,
[
'method'
=>
'post | get'
]
],
...
...
public/resource/js/user.js
View file @
07d2bf03
...
@@ -685,6 +685,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
...
@@ -685,6 +685,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
},
},
add_user
:
function
()
{
add_user
:
function
()
{
var
params
=
{};
var
params
=
{};
params
.
id
=
0
;
params
.
user_name
=
$
(
"#add_user_form input[name='user_name']"
).
val
();
params
.
user_name
=
$
(
"#add_user_form input[name='user_name']"
).
val
();
params
.
user_phone
=
$
(
"#add_user_form input[name='user_phone']"
).
val
();
params
.
user_phone
=
$
(
"#add_user_form input[name='user_phone']"
).
val
();
params
.
agent_id
=
user
.
agent_id
;
//客方
params
.
agent_id
=
user
.
agent_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