Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac-quanmin
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HTML5-李恒逸
sunac-quanmin
Commits
ae121a96
Commit
ae121a96
authored
Jun 12, 2017
by
html5-李恒逸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改二次报备页面跳转
parent
525c511f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
275 additions
and
275 deletions
+275
-275
report.php
html/application/controllers/admin/report.php
+133
-133
customer_building_model.php
html/application/models/customer_building_model.php
+46
-44
index_info.php
html/application/views/admin/report/index_info.php
+60
-61
report_again.php
html/application/views/admin/report/report_again.php
+36
-37
No files found.
html/application/controllers/admin/report.php
View file @
ae121a96
...
...
@@ -10,7 +10,7 @@ class Report extends CI_Controller
//报备状态
protected
$_status
=
array
();
/**
* 构造器
*/
...
...
@@ -23,7 +23,7 @@ class Report extends CI_Controller
//语言包
$this
->
lang
->
load
(
'op_log'
,
'chinese'
);
$this
->
u_name
=
$this
->
session
->
userdata
(
'user_name'
);
//加载菜单
$this
->
load
->
helper
(
'util'
);
$this
->
data
[
'menu'
]
=
newgenerate_menu
();
...
...
@@ -33,7 +33,7 @@ class Report extends CI_Controller
//模型
$this
->
load
->
model
(
'activity_model'
,
'activity'
);
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
?
true
:
false
;
$is_admin
=
$this
->
session
->
userdata
(
'type'
)
==
1
&&
$this
->
session
->
userdata
(
'role'
)
?
true
:
false
;
// if(!$this->session->userdata('u_id') || !$is_admin)
// {
// alert_redirect(site_url('admin/index/login'));
...
...
@@ -59,7 +59,7 @@ class Report extends CI_Controller
}
/**
*
*
* 显示分销注册列表
* @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话
* @author chenqt
...
...
@@ -73,12 +73,12 @@ class Report extends CI_Controller
// var_dump($results);
// exit;
$get
=
$this
->
input
->
get
();
$this
->
load
->
model
(
'op_log_model'
,
'oplog'
);
$this
->
load
->
model
(
'manager_model'
,
'manager'
);
$this
->
data
[
'customer_type'
]
=
array
(
'新客户'
,
'老业主'
,
'员工'
,
'员工/老业主'
);
$con_arr
=
array
(
$con_arr
=
array
(
'data_type'
=>
$get
[
'data_type'
]
?
:
'new'
,
'project_name'
=>
$get
[
'project_name'
]
?
:
''
,
'company_name'
=>
$get
[
'company_name'
]
?
:
''
,
...
...
@@ -88,8 +88,8 @@ class Report extends CI_Controller
'end_day'
=>
$get
[
'end_day'
]
?
:
''
,
'recommend_status'
=>
isset
(
$get
[
'recommend_status'
])
&&
$get
[
'recommend_status'
]
?
$get
[
'recommend_status'
]
:
array
(),
);
if
(
!
$this
->
session
->
userdata
(
'u_id'
))
{
alert_redirect
(
site_url
(
'admin/index/login'
));
...
...
@@ -97,31 +97,31 @@ class Report extends CI_Controller
}
//更新小红点
$manager_id
=
$this
->
session
->
userdata
[
'u_id'
];
$op_log
=
$this
->
oplog
->
get_last_by_manager
(
$manager_id
);
if
(
$op_log
)
{
$dataL
[
'update_time'
]
=
time
();
$where
=
'id = '
.
$op_log
[
'id'
];
$where
=
'id = '
.
$op_log
[
'id'
];
$this
->
oplog
->
update_time
(
$op_log
[
'id'
]);
}
//解析过滤条件
//$con_arr = explode('_',$condition);
$this
->
data
[
'con_arr'
]
=
$con_arr
;
$where
=
$this
->
_search
(
$con_arr
);
$count
=
$this
->
customer_building
->
get_report_count
(
$where
);
$this
->
data
[
'count'
]
=
$count
;
$customers
=
$this
->
customer_building
->
get_report_list
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
if
(
$customers
)
{
//查找楼盘的经理和销售员关系
foreach
(
$customers
as
$key
=>
$item
)
{
...
...
@@ -132,20 +132,20 @@ class Report extends CI_Controller
}
}
$this
->
data
[
'customers'
]
=
$customers
;
//echo '<pre>';print_r($customers);die;
$data_arr
=
'?'
.
http_build_query
(
$con_arr
);
$this
->
data
[
'recommend_status'
]
=
$this
->
_status
;
//获取分页
$this
->
data
[
'num_link'
]
=
set_page_new
(
$data_arr
,
$this
,
site_url
(
'admin/report/index'
),
$count
,
self
::
PAGE_SIZE
,
4
,
''
,
true
);
$this
->
data
[
'num_start'
]
=
(
$page_no
-
1
)
*
self
::
PAGE_SIZE
+
1
;
$this
->
data
[
'managers'
]
=
$this
->
manager
->
get_manager_name
();
$this
->
load
->
view
(
'admin/report/index_info'
,
$this
->
data
);
}
...
...
@@ -184,12 +184,12 @@ class Report extends CI_Controller
}
}
$this
->
data
[
'customers'
]
=
$customers
;
$data_arr
=
'?'
.
http_build_query
(
$con_arr
);
//获取分页
$this
->
data
[
'num_link'
]
=
set_page_new
(
$data_arr
,
$this
,
site_url
(
'admin/report/index'
),
$count
,
self
::
PAGE_SIZE
,
4
,
''
,
true
);
$this
->
load
->
view
(
'admin/report/common_area'
,
$this
->
data
);
}
...
...
@@ -243,7 +243,7 @@ class Report extends CI_Controller
//导出
$titles
=
'分销商名称,项目名称,客户姓名,客户电话,身份证号,客户类型,报备时间,分配时间,报备状态,销售顾问,销售经理,经纪人,渠道,备注,是否报备无效'
;
$titles
=
iconv
(
'utf-8'
,
'gbk'
,
$titles
);
$titles
=
iconv
(
'utf-8'
,
'gbk'
,
$titles
);
$this
->
export
->
export_excel
(
iconv
(
'utf-8'
,
'gbk'
,
'报备报表'
)
.
'.xls'
,
$titles
,
$data
);
}
...
...
@@ -268,30 +268,30 @@ class Report extends CI_Controller
//$building_id = 1567;
//校验楼盘是否有销售管理人员
$query_sql
=
"SELECT IFNULL(manager_id,0) as manager_id FROM tb_sales_building WHERE `building_id` =
$building_id
AND is_deleted = 0 GROUP BY manager_id"
;
$building_managers
=
$this
->
sales_building
->
get_all_manager_by_sql
(
$query_sql
);
$string
=
''
;
if
(
empty
(
$building_managers
)){
return
$string
;
}
else
{
$string
.=
"<div class='newuserUl'>"
;
$string
.=
"<div class='userUlsearch'><input type='search' name='uname' placeholder='输入姓名搜索' class='search_uname form-control input-inline' id='search_uname'></div>"
;
$string
.=
"<ul class='userUl' data-cbid='"
.
$cb_id
.
"'>"
;
foreach
(
$building_managers
as
$key
=>
$manager
)
foreach
(
$building_managers
as
$key
=>
$manager
)
{
$managerInfo
=
$this
->
user
->
get
(
array
(
'id'
=>
$manager
[
'manager_id'
]));
if
(
$managerInfo
[
'is_forbidden'
]
==
1
)
continue
;
//离职不展示
if
(
$managerInfo
)
if
(
$managerInfo
)
{
$string
.=
"<li data-type='manager' data-mid='"
.
$managerInfo
[
'id'
]
.
"' data-sid='0'>"
.
'|-- '
.
$managerInfo
[
'true_name'
]
.
'</li>'
;
}
else
{
$string
.=
"<li data-type='manager' data-mid='0' data-sid='0'>"
.
'|-- 无销售经理</li>'
;
}
//无销售经理
if
(
$manager
[
'manager_id'
]
==
0
)
{
...
...
@@ -304,8 +304,8 @@ class Report extends CI_Controller
if
(
$sales
)
{
foreach
(
$sales
as
$kk
=>
$val
)
{
foreach
(
$sales
as
$kk
=>
$val
)
{
$string
.=
"<li data-type='sale' data-mid='"
.
(
$managerInfo
[
'id'
]
?
:
0
)
.
"' data-sid='"
.
$val
[
'sale_uid'
]
.
"'>"
.
'|--'
.
str_repeat
(
'-'
,
6
)
.
$val
[
'sale_name'
]
.
'</li>'
;
}
}
...
...
@@ -315,7 +315,7 @@ class Report extends CI_Controller
$string
.=
"<div class='newbig'>"
;
$string
.=
"<div class='newdetermine'>确定</div>"
;
$string
.=
"<div class='newcancel'>取消</div>"
;
$string
.=
"</div>"
;
$string
.=
'</div>'
;
}
...
...
@@ -326,7 +326,7 @@ class Report extends CI_Controller
* 分配给销售经理/销售员
*/
public
function
allot
()
{
{
$post
=
$this
->
input
->
post
();
$this
->
load
->
model
(
'report_log_model'
,
'report'
);
//$this->load->model('customer_building_log_model', 'customer_building_log');
...
...
@@ -337,7 +337,7 @@ class Report extends CI_Controller
$this
->
load
->
helper
(
'eas'
);
if
(
$post
)
{
$userType
=
$post
[
'userType'
];
$saleId
=
(
int
)
$post
[
'sid'
];
...
...
@@ -352,9 +352,9 @@ class Report extends CI_Controller
//重新分配,记录日志
//if ($reset) {
$customerBuilding
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$cbid
));
$reportedInfo
=
$this
->
customer_building
->
get_report_id
(
$customerBuilding
[
'id'
]);
//若此客户已经分配,其他报备则不可分配
if
(
$reportedInfo
&&
$reportedInfo
[
'id'
]
!=
$cbid
)
{
$result
=
array
(
'errcode'
=>
5
,
'errmsg'
=>
'操作失败,此客户已分配销售!'
);
...
...
@@ -366,10 +366,10 @@ class Report extends CI_Controller
$result
=
array
(
'errcode'
=>
6
,
'errmsg'
=>
'状态不符,不能重新分配!'
);
echo
json_encode
(
$result
);
exit
;
}
//if ($customerBuilding['distribution_status'])
if
(
$customerBuilding
)
{
$dataLog
[
'user_id'
]
=
$customerBuilding
[
'user_id'
];
$dataLog
[
'customer_id'
]
=
$customerBuilding
[
'customer_id'
];
...
...
@@ -384,25 +384,25 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'action_time'
]
=
time
();
$dataLog
[
'remark'
]
=
'分配销售'
;
$this
->
customer_building_log
->
add
(
$dataLog
);
}
//}
$data
=
array
(
'assign_time'
=>
time
(),
'update_time'
=>
time
());
//分配给销售员
if
(
$post
[
'userType'
]
==
'sale'
)
if
(
$post
[
'userType'
]
==
'sale'
)
{
$data
[
'manager_id'
]
=
$managerId
;
$data
[
'sale_id'
]
=
$saleId
;
$data
[
'distribution_status'
]
=
2
;
if
(
$customerBuilding
[
'recommend_status'
]
<=
1
){
$data
[
'recommend_status'
]
=
1
;
$data
[
'recommend_status'
]
=
1
;
}
else
{
$data
[
'recommend_status'
]
=
$customerBuilding
[
'recommend_status'
];
$data
[
'recommend_status'
]
=
$customerBuilding
[
'recommend_status'
];
}
$data
[
'update_time'
]
=
time
();
...
...
@@ -411,16 +411,16 @@ class Report extends CI_Controller
$data
[
'sale_id'
]
=
0
;
$data
[
'distribution_status'
]
=
1
;
if
(
$customerBuilding
[
'recommend_status'
]
<=
1
){
$data
[
'recommend_status'
]
=
1
;
$data
[
'recommend_status'
]
=
1
;
}
else
{
$data
[
'recommend_status'
]
=
$customerBuilding
[
'recommend_status'
];
$data
[
'recommend_status'
]
=
$customerBuilding
[
'recommend_status'
];
}
$data
[
'update_time'
]
=
time
();
}
//$where = "id = " . $cbid;
$flag
=
$this
->
customer_building
->
update
(
array
(
'id'
=>
$cbid
),
$data
);
if
(
$flag
){
//如果是销售员,加跟踪记录
if
(
$post
[
'userType'
]
!=
'manager'
)
{
...
...
@@ -434,18 +434,18 @@ class Report extends CI_Controller
/* ================================new 分配后推送给EAS=====================================*/
$newcustomerInfo
=
$this
->
customer_building
->
newget_customer_info
(
$cbid
);
if
(
$newcustomerInfo
)
{
$api
=
new
easApi
();
//分配时间
$t
=
time
();
$time
=
date
(
"Y-m-d"
,
$t
);
//分配给销售
if
(
$post
[
'userType'
]
==
'sale'
)
{
if
(
$post
[
'userType'
]
==
'sale'
)
{
$newcustomerId
=
$api
->
newimportCustomer
(
$newcustomerInfo
[
'customer_user'
],
$newcustomerInfo
[
'customer_mobile'
],
$newcustomerInfo
[
'buildingId'
],
$newcustomerInfo
[
'building_title'
],
$newcustomerInfo
[
'rongchuang_id'
],
$newcustomerInfo
[
'user_mobile'
],
$time
);
//分配给销售经理
}
else
if
(
$post
[
'userType'
]
==
'manager'
){
...
...
@@ -454,13 +454,13 @@ class Report extends CI_Controller
$newcustomer
=
array
(
'rongchuang_id'
=>
$newcustomerId
);
if
(
$newcustomerId
){
$this
->
customer
->
add_rongchuang_id
(
$newcustomerInfo
[
'customerId'
],
$newcustomer
);
}
}
/* ================================new 分配后推送给EAS=====================================*/
...
...
@@ -489,10 +489,10 @@ class Report extends CI_Controller
foreach
(
$customerId
as
$value
)
{
$results
=
$api
->
newgetCustomerVisit
(
array
(
'customer_id'
=>
$value
[
'rongchuang_id'
]));
if
(
!
empty
(
$results
)){
$entity_id
=
$this
->
customer_building
->
get_building_id
(
$value
[
'id'
]);
//记录客户跟进信息
$customerBuilding
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$entity_id
[
'id'
]));
$customerBuilding
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$entity_id
[
'id'
]));
if
(
$customerBuilding
[
'recommend_status'
]
<
2
){
$this
->
customer_building
->
update_customer_building
(
$value
[
'id'
],
array
(
'recommend_status'
=>
2
));
}
...
...
@@ -510,7 +510,7 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'action_time'
]
=
time
();
$dataLog
[
'remark'
]
=
'客户到访'
;
}
$parme
=
array
(
'entity_type'
=>
'1'
,
...
...
@@ -523,9 +523,9 @@ class Report extends CI_Controller
'customer_id'
=>
$customerBuilding
[
'customer_id'
],
'recommend_status'
=>
'2'
);
$logfahui
=
$this
->
customer_building_log
->
screening_recommend_status
(
$log_screening
);
if
(
empty
(
$logfahui
)){
$this
->
customer_building_log
->
add
(
$dataLog
);
}
...
...
@@ -534,15 +534,15 @@ class Report extends CI_Controller
'entity_id'
=>
$entity_id
[
'id'
],
'trace_status'
=>
'2'
);
$screeningfahui
=
$this
->
recommend
->
screening_recommend_status
(
$screening
);
if
(
empty
(
$screeningfahui
)){
$this
->
recommend
->
add_recommend_trace
(
$parme
);
}
}
};
}
}
//记录客户认购在后台自执行
...
...
@@ -557,7 +557,7 @@ class Report extends CI_Controller
if
(
$customerId
){
foreach
(
$customerId
as
$value
)
{
$results
=
$api
->
newgetCustomerPurchase
(
array
(
'customer_id'
=>
$value
[
'rongchuang_id'
]));
if
(
!
empty
(
$results
)){
$entity_id
=
$this
->
customer_building
->
get_building_id
(
$value
[
'id'
]);
//记录客户跟进信息
...
...
@@ -579,7 +579,7 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'action_time'
]
=
time
();
$dataLog
[
'remark'
]
=
'客户认购'
;
}
$parme
=
array
(
'entity_type'
=>
'1'
,
...
...
@@ -592,9 +592,9 @@ class Report extends CI_Controller
'customer_id'
=>
$customerBuilding
[
'customer_id'
],
'recommend_status'
=>
'3'
);
$logfahui
=
$this
->
customer_building_log
->
screening_recommend_status
(
$log_screening
);
if
(
empty
(
$logfahui
)){
$this
->
customer_building_log
->
add
(
$dataLog
);
}
...
...
@@ -603,9 +603,9 @@ class Report extends CI_Controller
'entity_id'
=>
$entity_id
[
'id'
],
'trace_status'
=>
'3'
);
$screeningfahui
=
$this
->
recommend
->
screening_recommend_status
(
$screening
);
if
(
empty
(
$screeningfahui
)){
$this
->
recommend
->
add_recommend_trace
(
$parme
);
}
...
...
@@ -646,7 +646,7 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'action_time'
]
=
time
();
$dataLog
[
'remark'
]
=
'客户签约'
;
}
$parme
=
array
(
'entity_type'
=>
'1'
,
...
...
@@ -654,15 +654,15 @@ class Report extends CI_Controller
'trace_status'
=>
'4'
,
'create_time'
=>
time
()
);
//防止重复报备log
$log_screening
=
array
(
'customer_id'
=>
$customerBuilding
[
'customer_id'
],
'recommend_status'
=>
'4'
);
$logfahui
=
$this
->
customer_building_log
->
screening_recommend_status
(
$log_screening
);
if
(
empty
(
$logfahui
)){
$this
->
customer_building_log
->
add
(
$dataLog
);
}
...
...
@@ -671,9 +671,9 @@ class Report extends CI_Controller
'entity_id'
=>
$entity_id
[
'id'
],
'trace_status'
=>
'4'
);
$screeningfahui
=
$this
->
recommend
->
screening_recommend_status
(
$screening
);
if
(
empty
(
$screeningfahui
)){
$this
->
recommend
->
add_recommend_trace
(
$parme
);
}
...
...
@@ -681,7 +681,7 @@ class Report extends CI_Controller
};
}
}
/**
*
...
...
@@ -716,7 +716,7 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'remark'
]
=
'报备无效'
;
$dataLog
[
'action_time'
]
=
time
();
$this
->
customer_building_log
->
add
(
$dataLog
);
}
...
...
@@ -760,7 +760,7 @@ class Report extends CI_Controller
//$where = 'SB.is_deleted = 0 and U.user_type = 3 and ';
$where
=
'CB.is_deleted = 0 AND CB.distributor_id !=0 and'
;
//数据类型:new:新报备,old: 公共区域客户
if
(
$con_arr
[
'data_type'
]
!=
NULL
&&
!
empty
(
$con_arr
[
'data_type'
]))
{
...
...
@@ -809,19 +809,19 @@ class Report extends CI_Controller
if
(
!
empty
(
$con_arr
[
'recommend_status'
]))
{
$where
.=
' CB.recommend_status in ('
.
implode
(
','
,
$con_arr
[
'recommend_status'
])
.
') and'
;
}
$user_id
=
(
int
)
$this
->
session
->
userdata
(
'u_id'
);
$info_region_id
=
$this
->
manager
->
get
(
array
(
'id'
=>
$user_id
));
if
(
!
empty
(
$info_region_id
)){
$r_id
=
$info_region_id
[
"region_id"
];
$b_id
=
$info_region_id
[
"building_id"
];
//$where .= ' B.id in('.$b_id.') and';
}
$buildings_select
=
$this
->
manager
->
get_buildings
(
'id = '
.
$user_id
);
$where
.=
' B.id in ('
.
$buildings_select
[
0
][
'building_id'
]
.
')'
;
$where
=
trim
(
$where
,
' and '
);
return
$where
;
}
...
...
@@ -876,24 +876,24 @@ class Report extends CI_Controller
//'manager_name' => $get['manager_name'] ? : '',
//'manager_phone' => $get['manager_phone'] ? : ''
);
$this
->
data
[
'con_arr'
]
=
$con_arr
;
$where
=
''
;
if
(
$con_arr
[
'company_name'
])
{
$where
.=
" D.company_name like '%"
.
$con_arr
[
'company_name'
]
.
"%' and"
;
$where
.=
" D.company_name like '%"
.
$con_arr
[
'company_name'
]
.
"%' and"
;
}
if
(
$con_arr
[
'building_title'
])
{
$where
.=
" B.building_title like '%"
.
$con_arr
[
'building_title'
]
.
"%' and"
;
$where
.=
" B.building_title like '%"
.
$con_arr
[
'building_title'
]
.
"%' and"
;
}
/*if ($con_arr['manager_name']) {
$where .= " M.manager_name like '%" . $con_arr['manager_name'] . "%' and";
$where .= " M.manager_name like '%" . $con_arr['manager_name'] . "%' and";
}
if ($con_arr['manager_phone']) {
$where .= " M.manager_phone like '%" . $con_arr['manager_phone'] . "%' and";
$where .= " M.manager_phone like '%" . $con_arr['manager_phone'] . "%' and";
}*/
//销管查看自己的分销商
...
...
@@ -905,18 +905,18 @@ class Report extends CI_Controller
}
$where
=
trim
(
$where
,
' and '
);
$count
=
$this
->
relate
->
get_relate_count
(
$where
);
$this
->
data
[
'count'
]
=
$count
;
$this
->
data
[
'distributors'
]
=
$this
->
relate
->
get_all
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
$data_arr
=
'?'
.
http_build_query
(
$con_arr
);
//获取分页
$this
->
data
[
'num_link'
]
=
set_page_new
(
$data_arr
,
$this
,
site_url
(
'admin/report/distributors'
),
$count
,
self
::
PAGE_SIZE
,
4
,
''
,
true
);
$this
->
data
[
'num_start'
]
=
(
$page_no
-
1
)
*
self
::
PAGE_SIZE
+
1
;
$this
->
load
->
view
(
'admin/report/distributor'
,
$this
->
data
);
}
...
...
@@ -939,7 +939,7 @@ class Report extends CI_Controller
$post
=
$this
->
input
->
post
();
if
(
$post
)
{
if
(
$post
[
'company_name'
]
&&
$post
[
'uniqid_id'
])
{
$data
[
'company_name'
]
=
addslashes
(
$post
[
'company_name'
]);
$data
[
'uniqid_id'
]
=
trim
(
$post
[
'uniqid_id'
]);
...
...
@@ -1008,7 +1008,7 @@ class Report extends CI_Controller
}
}
if
(
$all_result
)
if
(
$all_result
)
{
$return
[
'result'
]
=
array_values
(
$all_result
);
$return
[
'errmsg'
]
=
''
;
...
...
@@ -1029,15 +1029,15 @@ class Report extends CI_Controller
$distributor_id
=
isset
(
$ids
[
0
])
?
$ids
[
0
]
:
'0'
;
$building_id
=
isset
(
$ids
[
1
])
?
$ids
[
1
]
:
'0'
;
//根据销管-〉楼盘 -〉WEB端用户ID
$manager_id
=
(
int
)
$this
->
session
->
userdata
(
'u_id'
);
$manager_info
=
$this
->
manager
->
get
(
array
(
'id'
=>
$manager_id
));
if
(
!
empty
(
$manager_info
)
&&
$manager_info
[
'role_id'
]
==
'10'
)
{
$userInfo
=
$this
->
relate
->
get
(
array
(
'user_id'
=>
$manager_id
,
'distributor_id'
=>
$distributor_id
,
'building_id'
=>
$building_id
));
if
(
!
$userInfo
)
{
$userId
=
$userInfo
[
'user_id'
];
...
...
@@ -1049,14 +1049,14 @@ class Report extends CI_Controller
$flag
=
$this
->
relate
->
add
(
$data
);
if
(
$flag
)
if
(
$flag
)
{
alert_redirect
(
site_url
(
'admin/report/distributors'
));
return
;
}
}
}
}
alert_redirect
(
site_url
(
'admin/report/distributors'
),
$this
->
lang
->
line
(
'err_42003'
));
alert_redirect
(
site_url
(
'admin/report/distributors'
),
$this
->
lang
->
line
(
'err_42003'
));
return
;
}
}
...
...
@@ -1066,8 +1066,8 @@ class Report extends CI_Controller
{
$post
=
$this
->
input
->
post
();
$this
->
load
->
model
(
'building_distributor_model'
,
'relate'
);
if
(
$post
[
'id'
]
>
0
)
if
(
$post
[
'id'
]
>
0
)
{
$data
[
'is_deleted'
]
=
$post
[
'is_deleted'
];
$data
[
'update_time'
]
=
time
();
...
...
@@ -1075,10 +1075,10 @@ class Report extends CI_Controller
$affect
=
$this
->
relate
->
update
(
"id = "
.
$post
[
'id'
],
$data
);
if
(
$affect
)
if
(
$affect
)
{
$return
=
array
(
'errcode'
=>
0
,
'errmsg'
=>
'操作成功'
);
}
}
echo
json_encode
(
$return
);
return
;
}
...
...
@@ -1091,7 +1091,7 @@ class Report extends CI_Controller
$post
=
$this
->
input
->
post
();
if
(
$post
)
{
$data
[
'company_name'
]
=
addslashes
(
$post
[
'company_name'
]);
$data
[
'manager_id'
]
=
(
int
)
$post
[
'manager_id'
];
$data
[
'remark'
]
=
addslashes
(
$post
[
'remark'
]);
...
...
@@ -1104,7 +1104,7 @@ class Report extends CI_Controller
alert_redirect
(
site_url
(
'admin/report/distributor'
));
return
;
}
alert_redirect
(
site_url
(
'admin/report/distributor'
),
$this
->
lang
->
line
(
'err_42003'
));
return
;
}
else
{
...
...
@@ -1112,7 +1112,7 @@ class Report extends CI_Controller
$this
->
data
[
'managers'
]
=
$this
->
manager
->
get_distributors
(
'R.id = 11'
);
//获取所有分销商的帐号
$this
->
load
->
view
(
'admin/report/distributorEdit'
,
$this
->
data
);
}
}
//我的经纪人
...
...
@@ -1137,7 +1137,7 @@ class Report extends CI_Controller
do
{
$uniqid_id
=
mt_rand
(
11111111
,
99999999
);
}
while
(
$this
->
distributor
->
get
(
array
(
'uniqid_id'
=>
$uniqid_id
)));
}
}
echo
$uniqid_id
;
;
}
...
...
@@ -1161,22 +1161,22 @@ class Report extends CI_Controller
$this
->
data
[
'con_arr'
]
=
$con_arr
;
$this
->
data
[
'uniqid_id'
]
=
!
empty
(
$distributor
[
'uniqid_id'
])
?
$distributor
[
'uniqid_id'
]
:
'0'
;
if
(
$this
->
data
[
'uniqid_id'
])
if
(
$this
->
data
[
'uniqid_id'
])
{
$where
=
'U.uniqid_id = "'
.
$this
->
data
[
'uniqid_id'
]
.
'"'
;
if
(
!
empty
(
$con_arr
[
'user_name'
]))
if
(
!
empty
(
$con_arr
[
'user_name'
]))
{
$where
.=
' and U.user_name like "%'
.
$con_arr
[
'user_name'
]
.
'%"'
;
}
if
(
!
empty
(
$con_arr
[
'user_mobile'
]))
if
(
!
empty
(
$con_arr
[
'user_mobile'
]))
{
$where
.=
' and U.user_mobile like "%'
.
$con_arr
[
'user_mobile'
]
.
'%"'
;
}
$count
=
$this
->
user
->
get_user_count
(
$where
);
$this
->
data
[
'count'
]
=
$count
;
$this
->
data
[
'agents'
]
=
$this
->
user
->
get_all_users
(
$where
,
'id,user_name,user_mobile,check_status,is_deleted,create_time'
,
$page_no
,
self
::
PAGE_SIZE
);
...
...
@@ -1186,7 +1186,7 @@ class Report extends CI_Controller
//获取分页
$this
->
data
[
'num_link'
]
=
set_page_new
(
$data_arr
,
$this
,
site_url
(
'admin/report/agents'
),
$count
,
self
::
PAGE_SIZE
,
4
,
''
,
true
);
}
}
$this
->
data
[
'num_start'
]
=
(
$page_no
-
1
)
*
self
::
PAGE_SIZE
+
1
;
$this
->
load
->
view
(
'admin/report/agents'
,
$this
->
data
);
}
...
...
@@ -1197,13 +1197,13 @@ class Report extends CI_Controller
{
$post
=
$this
->
input
->
post
();
if
(
$post
)
if
(
$post
)
{
$id
=
(
int
)
$post
[
'id'
];
$data
[
'check_status'
]
=
(
int
)
$post
[
'check_status'
];
$data
[
'update_time'
]
=
time
();
if
(
$this
->
user
->
update
(
array
(
'id'
=>
(
int
)
$post
[
'id'
]),
$data
))
if
(
$this
->
user
->
update
(
array
(
'id'
=>
(
int
)
$post
[
'id'
]),
$data
))
{
echo
json_encode
(
array
(
'errcode'
=>
0
,
'errmsg'
=>
'操作成功!'
));
}
else
{
...
...
@@ -1215,7 +1215,7 @@ class Report extends CI_Controller
/**
*
*
* 二次报备列表
* @param string $condition 过滤条件 数据类型 + 分销商+客户姓名+客户电话
* @author chenqt
...
...
@@ -1224,7 +1224,7 @@ class Report extends CI_Controller
public
function
reportAgain
(
$page_no
=
1
)
{
$get
=
$this
->
input
->
get
();
$this
->
data
[
'customer_type'
]
=
array
(
'新客户'
,
'老业主'
,
'员工'
,
'员工/老业主'
);
$con_arr
=
array
(
...
...
@@ -1238,21 +1238,21 @@ class Report extends CI_Controller
);
$manager_id
=
$this
->
session
->
userdata
[
'u_id'
];
//解析过滤条件
$this
->
data
[
'con_arr'
]
=
$con_arr
;
$where
=
$this
->
_search
(
$con_arr
);
$where
.=
" and CB.report_
status != 'NEVER' and CB.recommend_status != 8
"
;
$where
.=
" and CB.report_
time <> 0
"
;
$count
=
$this
->
customer_building
->
get_report_count
(
$where
);
$this
->
data
[
'count'
]
=
$count
;
$customers
=
$this
->
customer_building
->
get_report_list
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
$customers
=
$this
->
customer_building
->
get_reportagain_list
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
$this
->
data
[
'customers'
]
=
$customers
;
//echo '<pre>';print_r($customers);die;
$data_arr
=
'?'
.
http_build_query
(
$con_arr
);
...
...
@@ -1261,13 +1261,13 @@ class Report extends CI_Controller
//获取分页
$this
->
data
[
'num_link'
]
=
set_page_new
(
$data_arr
,
$this
,
site_url
(
'admin/report/index'
),
$count
,
self
::
PAGE_SIZE
,
4
,
''
,
true
);
$this
->
load
->
view
(
'admin/report/report_again'
,
$this
->
data
);
$this
->
load
->
view
(
'admin/report/report_again'
,
$this
->
data
);
}
//是否通过二次报备
public
function
reportAnother
()
{
$time
=
time
();
$cb_id
=
(
int
)
$_POST
[
'id'
];
$status
=
in_array
(
$_POST
[
'status'
],
array
(
'SUCCESS'
,
'REJECT'
))
?
$_POST
[
'status'
]
:
''
;
...
...
@@ -1281,10 +1281,10 @@ class Report extends CI_Controller
'report_status'
=>
$status
,
'report_action_time'
=>
$time
,
);
$this
->
customer_building
->
update
(
array
(
'id'
=>
$cb_id
),
$customer_building_data
);
$this
->
customer_building
->
update
(
array
(
'id'
=>
$cb_id
),
$customer_building_data
);
$cbinfo
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$cb_id
));
$dataLog
[
'user_id'
]
=
$cbinfo
[
'user_id'
];
$dataLog
[
'customer_id'
]
=
$cbinfo
[
'customer_id'
];
$dataLog
[
'building_id'
]
=
$cbinfo
[
'building_id'
];
...
...
@@ -1297,10 +1297,10 @@ class Report extends CI_Controller
$dataLog
[
'create_time'
]
=
$cbinfo
[
'create_time'
];
$dataLog
[
'action_time'
]
=
$time
;
$dataLog
[
'remark'
]
=
$status
==
'SUCCESS'
?
'通过二次报备'
:
'拒绝二次报备'
;
$this
->
customer_building_log
->
add
(
$dataLog
);
$return
=
200
;
}
echo
json_encode
(
array
(
'status'
=>
200
));
;
echo
json_encode
(
array
(
'status'
=>
200
));
;
}
}
html/application/models/customer_building_model.php
View file @
ae121a96
<?php
/**
* 客户楼盘关联模型
*
*
* @package application/model
* @version 2012-10-31
* @author wenhuijang
...
...
@@ -13,7 +13,7 @@ class Customer_building_model extends MY_Model{
* 使用到的表
*/
public
$table
=
'tb_customer_building'
;
/**
* 构造器
*/
...
...
@@ -23,7 +23,7 @@ class Customer_building_model extends MY_Model{
//进行数据库连接
$this
->
db
=
$this
->
load
->
database
(
'default'
,
true
);
}
/**
* 总数
* @param int $where
...
...
@@ -124,11 +124,11 @@ class Customer_building_model extends MY_Model{
$this
->
db
->
where
(
$where
);
}
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
row_array
();
return
$return
[
'total'
];
}
return
0
;
...
...
@@ -154,16 +154,16 @@ class Customer_building_model extends MY_Model{
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
}
$this
->
db
->
order_by
(
'CB.id'
,
'desc'
);
$query
=
$this
->
db
->
get
(
null
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
result_array
();
return
$return
;
}
return
array
();
...
...
@@ -183,17 +183,20 @@ class Customer_building_model extends MY_Model{
->
join
(
'tb_channel CC'
,
'CC.id=D.channel_id'
,
'left'
)
->
join
(
'tb_manager TM'
,
'TM.id=CC.manager_id'
,
'left'
)
->
join
(
'tb_building_distributor_relate RR'
,
'RR.building_id=CB.building_id AND D.id=RR.distributor_id'
,
'left'
)
->
join
(
'tb_manager M'
,
'RR.user_id=M.id'
,
'left'
)
->
where
(
'CB.report_time <> 0'
);
->
join
(
'tb_manager M'
,
'RR.user_id=M.id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
}
$this
->
db
->
order_by
(
'CB.id'
,
'desc'
);
$query
=
$this
->
db
->
get
(
null
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
result_array
();
return
$return
;
}
return
array
();
...
...
@@ -240,7 +243,7 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
* 分页数据
* @param string $where
...
...
@@ -253,9 +256,9 @@ class Customer_building_model extends MY_Model{
public
function
get_customer_building_page
(
$where
=
NULL
,
$page
=
0
,
$page_size
=
0
,
$order
=
NULL
)
{
$this
->
db
->
select
(
'
CB.*, R.region_name, B.building_title,
C.customer_user, C.customer_mobile,
UP.true_name as sales_name,
CB.*, R.region_name, B.building_title,
C.customer_user, C.customer_mobile,
UP.true_name as sales_name,
U.true_name as recom_name, U.check_status
'
)
->
from
(
'tb_customer_building CB'
)
...
...
@@ -264,7 +267,7 @@ class Customer_building_model extends MY_Model{
->
join
(
'tb_region R'
,
'R.region_code = CB.city_code '
,
'left'
)
->
join
(
'tb_user UP'
,
'UP.id = CB.sale_id'
,
'left'
)
->
join
(
'tb_user U'
,
'U.id = CB.user_id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
...
...
@@ -275,7 +278,7 @@ class Customer_building_model extends MY_Model{
}
else
{
$this
->
db
->
order_by
(
'CB.id'
,
'desc'
);
}
$query
=
$this
->
db
->
get
(
NULL
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -283,26 +286,26 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
* 管理后台详情(佣金详情)
* @param string $where
* @return boolean
*/
public
function
get_customer_building_info
(
$where
=
NULL
){
$this
->
db
->
select
(
'CB.*, R.region_name,
$this
->
db
->
select
(
'CB.*, R.region_name,
B.building_title, B.sort_num, B.building_addr, B.contact_user, B.contact_mobile, B.remark,
C.customer_user, C.customer_mobile'
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_customer C'
,
'C.id = CB.customer_id '
,
'left'
)
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_region R'
,
'R.region_code = CB.city_code '
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
}
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -310,7 +313,7 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
* 前台列表数据(佣金列表, 销售客户列表)
* @param string $where
...
...
@@ -328,7 +331,7 @@ class Customer_building_model extends MY_Model{
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_user U'
,
'U.id = CB.user_id'
,
'left'
)
->
join
(
'tb_distributor D'
,
'D.uniqid_id=U.uniqid_id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
...
...
@@ -339,7 +342,7 @@ class Customer_building_model extends MY_Model{
}
else
{
$this
->
db
->
order_by
(
'CB.update_time'
,
'desc'
);
}
$query
=
$this
->
db
->
get
(
NULL
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -347,26 +350,26 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
* 前台顾客详情
*
*
* @param string $where
* @return boolean
*/
public
function
get_customer_building_web_info
(
$where
=
NULL
){
$this
->
db
->
select
(
'CB.*, R.region_name, B.building_id as rc_building_id, B.building_title, C.customer_user, C.customer_mobile'
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_customer C'
,
'C.id = CB.customer_id '
,
'left'
)
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_region R'
,
'R.region_code = CB.city_code '
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
}
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -374,7 +377,7 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
*
* 前台 销售经理获取负责楼盘项目数据
...
...
@@ -392,7 +395,7 @@ class Customer_building_model extends MY_Model{
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_building B'
,
'CB.building_id = B.id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
...
...
@@ -423,7 +426,7 @@ class Customer_building_model extends MY_Model{
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_user U'
,
'CB.user_id = U.id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
...
...
@@ -460,7 +463,7 @@ class Customer_building_model extends MY_Model{
}
$this
->
db
->
group_by
(
'CB.city_code'
);
$this
->
db
->
order_by
(
'CB.city_code desc'
);
$query
=
$this
->
db
->
get
(
null
);
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -468,8 +471,8 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
/**
* 客户是否被推荐
*
...
...
@@ -477,16 +480,16 @@ class Customer_building_model extends MY_Model{
* @return boolean
*/
public
function
exits_customer_building
(
$where
=
NULL
,
$getall
=
false
){
$this
->
db
->
select
(
'CB.id,CB.recommend_status,CB.customer_id,CB.is_valid,CB.distribution_status,CB.distributor_id'
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_customer C'
,
'C.id = CB.customer_id '
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
$where
);
}
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
...
...
@@ -516,7 +519,7 @@ class Customer_building_model extends MY_Model{
}
$this
->
db
->
order_by
(
'CB.create_time desc'
);
if
(
!
$page
)
if
(
!
$page
)
{
$query
=
$this
->
db
->
get
();
}
else
{
...
...
@@ -658,7 +661,7 @@ class Customer_building_model extends MY_Model{
$this
->
db
->
where
(
'customer_id'
,
$customerId
);
$this
->
db
->
update
(
'tb_customer_building'
,
$status
);
}
//获取‘tb_customer_building’里的id
public
function
get_building_id
(
$Id
){
$this
->
db
->
select
(
'CB.id'
);
...
...
@@ -671,4 +674,4 @@ class Customer_building_model extends MY_Model{
}
return
false
;
}
}
\ No newline at end of file
}
html/application/views/admin/report/index_info.php
View file @
ae121a96
...
...
@@ -56,7 +56,7 @@
display
:
block
;
border
:
1px
solid
#ddd
;
border-bottom
:
none
;
}
.userUlsearch
input
{
width
:
80%
;
...
...
@@ -130,18 +130,18 @@
</div>
<div
class=
"clearfix"
>
</div>
<!-- BEGIN CONTAINER -->
<div
class=
"page-container"
>
<div
class=
"page-container"
>
<!-- BEGIN SIDEBAR -->
<?php
$this
->
load
->
view
(
'admin/leftbar'
);
?>
<!-- END SIDEBAR -->
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div
class=
"page-content-wrapper"
>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<!-- BEGIN PAGE HEADER-->
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<ul
class=
"page-breadcrumb breadcrumb"
>
<li>
<i
class=
"fa fa-home"
></i>
<a
href=
"
<?php
echo
site_url
(
'admin/index'
);
?>
"
>
主页
</a>
<i
class=
"fa fa-angle-right"
></i>
</li>
...
...
@@ -149,15 +149,15 @@
<li>
<a
href=
"
<?php
echo
site_url
(
'admin/report'
);
?>
"
>
客户报备
</a>
<i
class=
"fa fa-angle-right"
></i>
</li>
<li>
<a
href=
"javascript:;"
>
新报备客户
</a>
</li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<!-- END PAGE HEADER-->
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div
class=
"portlet box blue"
>
<div
class=
"portlet-title"
style=
"display:none"
>
<div
id=
"new"
class=
"caption
<?php
echo
$con_arr
[
'data_type'
]
==
'new'
?
'selected'
:
''
;
?>
"
style=
"float: left;width:50%;height:25px;text-align: center;line-height: 25px;border-radius: 5px;cursor: pointer"
>
<i
class=
"fa "
></i>
新报备客户
</div>
...
...
@@ -170,20 +170,20 @@
<form
action=
"
<?php
echo
site_url
(
'admin/report/index'
);
?>
"
name=
'form'
method=
"get"
style=
"padding-left:5px;"
>
<input
type=
"hidden"
id=
"data_type"
name=
"data_type"
value=
"
<?php
echo
$con_arr
[
'data_type'
];
?>
"
>
项目名称:
<input
type=
"text"
class=
"form-control input-inline input-small"
name=
" project_name"
value=
"
<?php
echo
$con_arr
[
'project_name'
];
?>
"
>
<input
type=
"text"
class=
"form-control input-inline input-small"
name=
"project_name"
value=
"
<?php
echo
$con_arr
[
'project_name'
];
?>
"
>
客户姓名:
<input
type=
"text"
class=
"form-control input-inline input-small"
name=
"customer_user"
value=
"
<?php
echo
$con_arr
[
'customer_user'
];
?>
"
>
客户电话:
<input
type=
"text"
class=
"form-control input-inline input-small"
name=
"customer_mobile"
value=
"
<?php
echo
$con_arr
[
'customer_mobile'
];
?>
"
>
分销商名称:
<input
id=
'parent_name'
name=
"company_name"
type=
"text"
class=
"form-control input-inline input-small"
value=
"
<?php
echo
isset
(
$managers
[
'manager_name'
])
?
$managers
[
'manager_name'
]
:
''
?>
"
/>
<input
id=
'parent_id'
name=
'parent_id'
type=
'hidden'
value=
"
<?php
echo
isset
(
$managers
[
'id'
])
?
$managers
[
'id'
]
:
''
?>
"
/>
<ul
class=
"col-md-4"
id=
"channel_list"
style=
"display:none;"
></ul>
<!-- <select type="text" class="form-control input-inline input-small" name="company_name" value="
<?php
echo
$con_arr
[
'company_name'
];
?>
">
<!-- <select type="text" class="form-control input-inline input-small" name="company_name" value="
<?php
echo
$con_arr
[
'company_name'
];
?>
">
<?php
if
(
!
empty
(
$managers
))
:
foreach
(
$managers
as
$manager
)
:
?>
...
...
@@ -197,7 +197,7 @@
结束时间:
<input
id=
'end_day'
name=
"end_day"
type=
"text"
class=
"form-control input-inline date-picker"
style=
"width:135px;"
value=
"
<?php
echo
$con_arr
[
'end_day'
];
?>
"
>
<div
class=
"checkbox"
>
报备状态:
<?php
if
(
$recommend_status
)
{
...
...
@@ -209,11 +209,11 @@
</label>
<?php
}
}
?>
</div>
<div
style=
'margin-top:5px;'
></div>
<button
type=
"submit"
class=
"btn blue"
id=
"search"
>
搜索
</button>
<input
type=
"reset"
class=
"btn red reset"
name=
"button2"
value=
"清空"
>
<button
class=
"btn green"
id=
"export"
>
导出
</button>
</form>
...
...
@@ -266,7 +266,7 @@
<td>
<?php
echo
$customer
[
'remark'
];
?>
</td>
<td><a
href=
"
<?php
echo
site_url
(
'admin/report/history/'
.
$customer
[
'customer_id'
])
?>
"
>
查看
</a></td>
<td>
<?php
if
(
$customer
[
'is_valid'
]
==
0
){
?>
<?php
if
(
$customer
[
'is_valid'
]
==
0
){
?>
<i>
报备无效
</i>
<?php
}
else
if
(
!
$customer
[
'assign_time'
]){
?>
<a
href=
"#"
class=
"notvalid btn default btn-xs red"
data-id=
"
<?php
echo
$customer
[
'id'
]
?>
"
><i
class=
"fa fa-times"
>
设置无效
</i></a>
...
...
@@ -284,12 +284,12 @@
<?php
}
?>
<?php
}
?>
<div
class=
"userList"
>
<?php
if
(
isset
(
$customer
[
'userList'
])
&&
!
empty
(
$customer
[
'userList'
]))
{
<?php
if
(
isset
(
$customer
[
'userList'
])
&&
!
empty
(
$customer
[
'userList'
]))
{
echo
$customer
[
'userList'
];
}
?>
</div>
</td>
</tr>
...
...
@@ -322,29 +322,29 @@
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php
$this
->
load
->
view
(
'admin/footer'
);
?>
<!-- BEGIN PAGE LEVEL PLUGINS -->
<link
rel=
"stylesheet"
href=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/css/datepicker.css"
/>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/select2/select2.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.js"
></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/js/backend/core/app.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/select2/select2.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.js"
></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/js/backend/core/app.js"
></script>
<script>
jQuery
(
document
).
ready
(
function
()
{
jQuery
(
document
).
ready
(
function
()
{
App
.
init
();
$
(
"#start_day"
).
datepicker
({
...
...
@@ -369,7 +369,7 @@
<?php
}
?>
var
con
=
$
(
this
).
val
();
var
i
;
var
str
=
''
;
...
...
@@ -389,9 +389,9 @@
});
$
(
'#channel_list'
).
html
(
str
);
});
//报备有效确认
$
(
'.notvalid'
).
click
(
function
(
event
)
{
var
dataId
=
$
(
this
).
attr
(
'data-id'
);
...
...
@@ -419,7 +419,7 @@
}
}
});
$
(
'.caption'
).
click
(
function
()
{
$
(
this
).
siblings
().
removeClass
(
'selected'
).
end
().
addClass
(
'selected'
);
...
...
@@ -433,12 +433,12 @@
$
(
'input[type="checkbox"]'
).
removeAttr
(
'checked'
);
$
(
'input[type="checkbox"]'
).
parent
().
removeClass
(
'checked'
);
});
//客户分配
$
(
'.allot'
).
click
(
function
(){
$
(
'.allot'
).
click
(
function
(){
var
_div
=
$
(
this
).
next
(
'.userList'
);
var
_number
=
$
(
this
).
parents
(
"tbody"
).
find
(
"tr"
).
length
/
2
;
//console.log(_number);
var
_index
=
$
(
this
).
parents
(
'.tr'
).
index
();
...
...
@@ -451,19 +451,19 @@
}
$
(
'.userList'
).
not
(
_div
).
hide
();
if
(
_div
.
is
(
':visible'
))
{
_div
.
hide
();
}
else
{
_div
.
show
();
}
});
//是否请求接口的判断变量
var
flag
=
0
;
$
(
'.newcancel'
).
click
(
function
(){
$
(
'.userList'
).
hide
();
flag
=
0
;
...
...
@@ -481,7 +481,7 @@
flag
=
1
;
$
(
'.userList li'
).
css
({
'background'
:
'none'
});
$
(
this
).
css
({
'background'
:
'#ddd'
});
_type
=
$
(
this
).
attr
(
'data-type'
);
_cbid
=
$
(
this
).
parents
(
'.tr'
).
attr
(
'data-cbid'
);
_mid
=
parseInt
(
$
(
this
).
attr
(
'data-mid'
));
...
...
@@ -490,14 +490,14 @@
if
(
_mid
<
1
&&
_sid
<
1
)
{
return
false
;
}
});
$
(
'.newdetermine'
).
click
(
function
(){
$
(
'.userList'
).
hide
();
$
(
'.hzz-keepout'
).
show
();
if
(
_type
&&
_mid
&&
flag
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
url
:
"
<?php
echo
site_url
(
'admin/report/allot'
)
?>
"
,
data
:{
userType
:
_type
,
cbid
:
_cbid
,
mid
:
_mid
,
sid
:
_sid
,
reset
:
_reset
},
...
...
@@ -507,7 +507,7 @@
alert
(
retdat
.
errmsg
);
flag
=
0
;
}
else
{
window
.
location
.
reload
();
flag
=
0
;
}
...
...
@@ -519,7 +519,7 @@
}
else
if
(
!
_mid
){
$
(
'.hzz-keepout'
).
hide
();
alert
(
"没有销售经理,不支持分配"
);
}
else
{
$
(
'.hzz-keepout'
).
hide
();
alert
(
'请选择销售'
);
...
...
@@ -527,9 +527,9 @@
});
//搜索姓名
$
(
'#search_uname'
).
on
(
'keyup click'
,
function
()
{
var
_val
=
$
.
trim
(
$
(
this
).
val
());
$
(
'.userUl'
).
find
(
'li'
).
each
(
function
(
index
){
console
.
log
(
$
(
this
).
text
()
+
_val
);
if
(
$
(
this
).
text
().
indexOf
(
_val
)
<
0
)
{
...
...
@@ -545,12 +545,12 @@
$
(
"#export"
).
click
(
function
(
event
){
event
.
preventDefault
();
var
param
=
"
<?php
echo
http_build_query
(
$con_arr
)
?>
"
;
window
.
location
.
href
=
"
<?php
echo
site_url
(
'admin/report/export_actions'
)
?>
?"
+
param
;
});
});
});
</script>
</body>
<!-- END BODY -->
</html>
\ No newline at end of file
</html>
html/application/views/admin/report/report_again.php
View file @
ae121a96
...
...
@@ -38,7 +38,7 @@
overflow-y
:
auto
;
border
:
1px
solid
#ddd
}
.userList
li
:hover
{
background
:
#fff
;
color
:
#000
;
...
...
@@ -49,18 +49,18 @@
</style>
<div
class=
"clearfix"
>
</div>
<!-- BEGIN CONTAINER -->
<div
class=
"page-container"
>
<div
class=
"page-container"
>
<!-- BEGIN SIDEBAR -->
<?php
$this
->
load
->
view
(
'admin/leftbar'
);
?>
<!-- END SIDEBAR -->
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div
class=
"page-content-wrapper"
>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<!-- BEGIN PAGE HEADER-->
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<ul
class=
"page-breadcrumb breadcrumb"
>
<li>
<i
class=
"fa fa-home"
></i>
<a
href=
"
<?php
echo
site_url
(
'admin/index'
);
?>
"
>
主页
</a>
<i
class=
"fa fa-angle-right"
></i>
</li>
...
...
@@ -68,20 +68,20 @@
<li>
<a
href=
"
<?php
echo
site_url
(
'admin/report'
);
?>
"
>
客户报备
</a>
<i
class=
"fa fa-angle-right"
></i>
</li>
<li>
<a
href=
"javascript:;"
>
二次报备
</a>
</li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<!-- END PAGE HEADER-->
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div
class=
"portlet box blue"
>
<div
class=
"portlet box blue"
>
<div
class=
"portlet-body clearfix"
>
<div
class=
"form-body"
style=
"padding:0"
>
<div
style=
"padding-left:5px;margin-bottom: 20px;background: #F9FCEF;padding: 10px 0;border: 1px solid #ccc;"
class=
"text-left"
>
<form
action=
"
<?php
echo
site_url
(
'admin/report/
index
'
);
?>
"
name=
'form'
method=
"get"
style=
"padding-left:5px;"
>
<form
action=
"
<?php
echo
site_url
(
'admin/report/
reportAgain
'
);
?>
"
name=
'form'
method=
"get"
style=
"padding-left:5px;"
>
<input
type=
"hidden"
id=
"data_type"
name=
"data_type"
value=
"
<?php
echo
$con_arr
[
'data_type'
];
?>
"
>
分销商名称:
<input
type=
"text"
class=
"form-control input-inline input-small"
name=
"company_name"
value=
"
<?php
echo
$con_arr
[
'company_name'
];
?>
"
>
...
...
@@ -97,7 +97,7 @@
结束时间:
<input
id=
'end_day'
name=
"end_day"
type=
"text"
class=
"form-control input-inline date-picker"
style=
"width:135px;"
value=
"
<?php
echo
$con_arr
[
'end_day'
];
?>
"
>
<div
class=
"checkbox"
>
报备状态:
<?php
if
(
$recommend_status
)
{
...
...
@@ -109,11 +109,11 @@
</label>
<?php
}
}
?>
</div>
<div
style=
'margin-top:5px;'
></div>
<button
type=
"submit"
class=
"btn blue"
id=
"search"
>
搜索
</button>
<input
type=
"reset"
class=
"btn red reset"
name=
"button2"
value=
"清空"
>
<button
class=
"btn green"
id=
"export"
>
导出
</button>
</form>
...
...
@@ -158,13 +158,13 @@
<td>
<?php
echo
$customer
[
'Mtrue_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'agent_name'
];
?>
</td>
<!-- <td>
<?php
//echo $customer['remark']; ?></td> -->
<
td
>
<?
php
if
(
$customer
[
'report_status'
]
==
'PENDING'
)
{
?>
<a href="javascript:void(0)" class="agree btn default btn-xs" data-id="
<?php
echo
$customer
[
'id'
];
?>
"><i class="fa fa-retweet">同意</i></a>
<a href="javascript:void(0)" class="reject btn default red btn-xs" data-id="
<?php
echo
$customer
[
'id'
];
?>
><i class="fa fa-pencil-square-o">拒绝</i></a>
<?php
}
else
{
<?php
}
else
{
if
(
$customer
[
'report_status'
]
==
'SUCCESS'
)
echo
'已同意二次报备'
;
if
(
$customer
[
'report_status'
]
==
'REJECT'
)
echo
'已拒绝二次报备'
;
}
?>
...
...
@@ -200,29 +200,29 @@
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php
$this
->
load
->
view
(
'admin/footer'
);
?>
<!-- BEGIN PAGE LEVEL PLUGINS -->
<link
rel=
"stylesheet"
href=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/css/datepicker.css"
/>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/select2/select2.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.js"
></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/js/backend/core/app.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/select2/select2.min.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/jquery.dataTables.js"
></script>
<script
type=
"text/javascript"
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/plugins/data-tables/DT_bootstrap.js"
></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script
src=
"
<?php
echo
APPLICATION_PATH
?>
/assets/js/backend/core/app.js"
></script>
<script>
jQuery
(
document
).
ready
(
function
()
{
jQuery
(
document
).
ready
(
function
()
{
App
.
init
();
$
(
"#start_day"
).
datepicker
({
...
...
@@ -289,7 +289,7 @@
}
}
});
$
(
'input[type="reset"]'
).
click
(
function
(){
$
(
'input[type="text"]'
).
attr
(
'value'
,
''
);
...
...
@@ -301,12 +301,12 @@
$
(
"#export"
).
click
(
function
(
event
){
event
.
preventDefault
();
var
param
=
"
<?php
echo
http_build_query
(
$con_arr
)
?>
"
;
window
.
location
.
href
=
"
<?php
echo
site_url
(
'admin/report/export_actions'
)
?>
?"
+
param
;
});
});
});
</script>
</body>
<!-- END BODY -->
</html>
\ No newline at end of file
</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