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
531c843f
Commit
531c843f
authored
Apr 09, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改添加部门总监
parent
c6595c37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
37 deletions
+50
-37
Broker.php
application/api_broker/controller/Broker.php
+6
-6
District.php
application/index/controller/District.php
+3
-3
ADistrict.php
application/model/ADistrict.php
+24
-13
district.js
public/resource/js/district.js
+17
-15
No files found.
application/api_broker/controller/Broker.php
View file @
531c843f
...
...
@@ -247,17 +247,17 @@ class Broker extends Basic
// 查询电话跟进数据
$UPhoneFollowPp_res
=
$UPhoneFollowPp
->
select_useraction_search
(
$user_id
,
$searchdate
);
$
table
=
new
AAgents
();
$
agent
=
new
AAgents
();
foreach
(
$UPhoneFollowPp_res
as
$k
=>
$v
){
$agents_res
=
$
table
->
verifyUser
(
'name,phone,img'
,
''
,[
'id'
=>
$v
[
'agent_id'
]]);
$agents_res
=
$
agent
->
verifyUser
(
'name,phone,img'
,
''
,[
'id'
=>
$v
[
'agent_id'
]]);
$UPhoneFollowPp_res
[
$k
][
'agentinfo'
]
=
$agents_res
?
$agents_res
[
'name'
]
.
'-'
.
$agents_res
[
'phone'
]
:
'未知'
;
$UPhoneFollowPp_res
[
$k
][
'user_pic'
]
=
AGENTHEADERIMGURL
.
$agents_res
[
'img'
];
$UPhoneFollowPp_res
[
$k
][
'label'
]
=
''
;
//电话跟进标签
if
(
$v
[
'labels_id'
]){
$
table
=
new
ULabels
();
$table_res
=
$
table
->
get_labelsname
(
$v
[
'labels_id'
]);
$
labels
=
new
ULabels
();
$table_res
=
$
labels
->
get_labelsname
(
$v
[
'labels_id'
]);
$UPhoneFollowPp_res
[
$k
][
'label'
]
=
$table_res
[
0
][
'name'
];
}
}
...
...
@@ -266,8 +266,8 @@ class Broker extends Basic
$user_res
=
$user
->
useraction_search_user_res
(
$user_id
);
$user_res
[
'user_pic'
]
=
HEADERIMGURL
.
$user_res
[
'user_pic'
];
$table
=
new
AAgents
();
$agents_res
=
$
table
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$user_res
[
'agent_id'
]]);
$agents_res
=
$
agent
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$user_res
[
'agent_id'
]]);
$user_res
[
'agentinfo'
]
=
$agents_res
?
$agents_res
[
'name'
]
.
'-'
.
$agents_res
[
'phone'
]
:
'未知'
;
$records
=
new
GOperatingRecords
();
...
...
application/index/controller/District.php
View file @
531c843f
...
...
@@ -45,7 +45,7 @@ class District extends Basic
if
(
$this
->
params
[
'district_name'
]
!=
NULL
)
{
if
(
$join
==
0
)
{
$field
=
'a.id,a.district_name,a.create_time'
;
$where
[
'status'
]
=
0
;
$where
[
'status'
]
=
0
;
$where
[
'district_name'
]
=
[
'LIKE'
,
$this
->
params
[
'district_name'
]
.
'%'
];
}
else
{
$where
.=
" AND district_name LIKE '
{
$this
->
params
[
'district_name'
]
}
%'"
;
...
...
@@ -113,9 +113,9 @@ class District extends Basic
}
if
(
$where
)
{
$
agen
t
=
new
ADistrict
();
$
distric
t
=
new
ADistrict
();
$field
=
'id,district_name'
;
$data
[
'data'
]
=
$
agen
t
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$data
[
'data'
]
=
$
distric
t
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
}
else
{
$data
[
'msg'
]
=
'没有部门信息'
;
}
...
...
application/model/ADistrict.php
View file @
531c843f
...
...
@@ -18,7 +18,8 @@ class ADistrict extends BaseModel
*
* @param $data
* @param $agents_id
* @return bool
* @return bool|mixed
* @throws \Exception
* @throws \think\exception\PDOException
*/
public
function
addDepartmentAgents
(
$data
,
$agents_id
)
{
...
...
@@ -43,13 +44,22 @@ class ADistrict extends BaseModel
$agents_info
=
$agents
->
where
([
'district_id'
=>
$id
,
'level'
=>
[
'in'
,
'20,30,40'
]
])
->
column
(
'id,level'
);
foreach
(
$agents_info
as
$k
=>
$v
)
{
if
(
$agents_id
!=
$k
)
{
//总监降级为业务员
$agents_data
[
$k
][
'id'
]
=
$k
;
$agents_data
[
$k
][
'level'
]
=
10
;
$agents_data
[
$k
][
'district_id'
]
=
$id
;
}
else
{
$agents_data
=
[];
if
(
empty
(
$agents_info
))
{
$agents_data
[
0
][
'id'
]
=
$agents_id
;
$agents_data
[
0
][
'level'
]
=
30
;
$agents_data
[
0
][
'district_id'
]
=
$id
;
}
else
{
foreach
(
$agents_info
as
$k
=>
$v
)
{
if
(
$agents_id
!=
$k
)
{
//总监降级为业务员
$agents_data
[
$k
][
'id'
]
=
$k
;
$agents_data
[
$k
][
'level'
]
=
10
;
$agents_data
[
$k
][
'district_id'
]
=
$id
;
}
$k
+=
1
;
if
(
$v
==
20
)
{
//店长升总监
$agents_data
[
$k
][
'level'
]
=
40
;
...
...
@@ -57,19 +67,20 @@ class ADistrict extends BaseModel
//业务员升总监
$agents_data
[
$k
][
'level'
]
=
30
;
}
$agents_data
[
$k
][
'id'
]
=
$
k
;
$agents_data
[
$k
][
'id'
]
=
$
agents_id
;
$agents_data
[
$k
][
'district_id'
]
=
$id
;
}
}
$agents
->
saveAll
(
$agents_data
);
$resu
t
lt
=
$id
;
$result
=
$id
;
$this
->
commit
();
}
else
{
$resu
t
lt
=
false
;
$result
=
false
;
$this
->
rollback
();
}
return
$resu
t
lt
;
return
$result
;
}
/**
...
...
@@ -130,7 +141,7 @@ class ADistrict extends BaseModel
if
(
isset
(
$v
->
id
))
{
if
(
$result
[
$k
][
'district_name'
])
{
$agents
=
Db
::
table
(
'a_agents'
)
->
field
(
'name,phone'
)
->
where
([
'status'
=>
0
,
'district_id'
=>
$v
->
id
'status'
=>
0
,
'district_id'
=>
$v
->
id
,
'level'
=>
[
'in'
,
'30,40'
]
])
->
find
();
$result
[
$k
][
'name'
]
=
$agents
[
'name'
]
.
'-'
.
$agents
[
'phone'
];
$result
[
$k
][
'store_num'
]
=
Db
::
table
(
'a_store'
)
->
where
([
...
...
public/resource/js/district.js
View file @
531c843f
...
...
@@ -3,6 +3,8 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
pageNum
:
10
,
district
:
0
,
agent_id
:
0
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
...
...
@@ -14,15 +16,15 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
district
.
getList
(
1
);
});
$
(
document
).
delegate
(
".edit"
,
"click"
,
function
()
{
//点击编辑
district
.
house
_id
=
$
(
this
).
attr
(
"data-id"
);
district
.
district
_id
=
$
(
this
).
attr
(
"data-id"
);
district
.
Edit
();
});
$
(
document
).
delegate
(
".submit_edit"
,
"click"
,
function
()
{
//提交编辑
district
.
Submit_edit
();
district
.
getList
();
district
.
getList
(
1
);
});
$
(
document
).
delegate
(
".mend"
,
"click"
,
function
()
{
//点击门店列表
district
.
house
_id
=
$
(
this
).
attr
(
"data-id"
);
district
.
district
_id
=
$
(
this
).
attr
(
"data-id"
);
district
.
Mend
();
});
$
(
document
).
on
(
'input'
,
'.phone_mend'
,
function
(
e
)
{
//搜索手机号码
...
...
@@ -43,11 +45,13 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
});
$
(
document
).
delegate
(
".mend_list li"
,
"click"
,
function
()
{
//点击列表
var
phone_name
=
$
(
this
).
find
(
".phone_name"
).
html
();
var
phone_id
=
$
(
this
).
find
(
".phone_id"
).
html
();
var
phone_phone
=
$
(
this
).
find
(
".phone-phone"
).
html
();
var
phone_span
=
$
(
this
).
find
(
".phone_span"
).
html
();
$
(
".phone_mend"
).
val
(
phone_name
+
phone_span
+
phone_phone
);
$
(
this
).
parent
().
hide
();
district
.
ldHtml
.
html
(
''
);
$
(
this
).
parent
().
empty
();
district
.
agent_id
=
phone_id
;
// district.ldHtml.html('');
return
false
;
});
...
...
@@ -56,7 +60,7 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/adddistrict'
,
//获取编辑数据
data
:
{
"id"
:
district
.
house
_id
},
data
:
{
"id"
:
district
.
district
_id
},
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
data
)
{
...
...
@@ -70,19 +74,17 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
});
},
Submit_edit
:
function
(){
//提交编辑的信息
var
par
=
{};
par
.
id
=
district
.
house
_id
;
par
.
department_name
=
$
(
"input[name =title]"
).
val
();
par
.
agents_id
=
$
(
"input[name =agents_id]"
).
val
()
;
var
par
=
{};
par
.
id
=
district
.
district
_id
;
par
.
department_name
=
$
(
"input[name =title]"
).
val
();
par
.
agents_id
=
district
.
agent_id
;
$
.
ajax
({
'type'
:
'POST'
,
'url'
:
'/index/adddistrict'
,
data
:
par
,
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
code
==
200
){
}
else
{
if
(
data
.
code
!=
200
){
alert
(
data
.
msg
);
}
}
...
...
@@ -93,7 +95,7 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/getDistrictStoreList'
,
//门店
data
:
{
"id"
:
district
.
house
_id
},
data
:
{
"id"
:
district
.
district
_id
},
dataType
:
"json"
,
success
:
function
(
data
){
if
(
data
.
code
==
200
){
...
...
@@ -125,7 +127,7 @@ define (['doT', 'text!temp/district_template_tpl.html', 'css!style/home.css','pa
if
(
data
.
code
===
200
){
var
_html
=
''
;
$
.
each
(
data
.
data
,
function
(
i
,
data
)
{
_html
+=
'<li><span class="phone_name">'
+
data
[
'name'
]
+
'</span><span class="phone_span">-</span><span class="phone-phone">'
+
data
[
'phone'
]
+
'</span> </li>'
;
_html
+=
'<li><span class="phone_
id">'
+
data
[
'id'
]
+
'</span><span class="phone_
name">'
+
data
[
'name'
]
+
'</span><span class="phone_span">-</span><span class="phone-phone">'
+
data
[
'phone'
]
+
'</span> </li>'
;
});
$
(
".mend_list"
).
html
(
_html
);
}
...
...
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