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
c153b91f
Commit
c153b91f
authored
Jun 26, 2017
by
HTML5-侯张振
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新接口添加
parent
d60907a1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
102 additions
and
12 deletions
+102
-12
buildingmanageradmin.php
html/application/controllers/admin/buildingmanageradmin.php
+6
-4
report.php
html/application/controllers/admin/report.php
+56
-4
customer_building_model.php
html/application/models/customer_building_model.php
+2
-2
manager_model.php
html/application/models/manager_model.php
+26
-0
index.php
html/application/views/admin/buildingmanager/index.php
+12
-2
No files found.
html/application/controllers/admin/buildingmanageradmin.php
View file @
c153b91f
...
...
@@ -27,7 +27,7 @@ class Buildingmanageradmin extends CI_Controller
$this
->
load
->
model
(
'user_model'
,
'user'
);
$this
->
load
->
model
(
'building_model'
,
'building'
);
$this
->
load
->
model
(
'user_building_model'
,
'user_building'
);
$this
->
load
->
model
(
'manager_model'
,
'manager'
);
//获取城市
//加入城市和楼盘的权限控制
$u_id
=
(
int
)
$this
->
session
->
userdata
(
'u_id'
);
...
...
@@ -52,16 +52,18 @@ class Buildingmanageradmin extends CI_Controller
//解析过滤条件
$con_arr
=
explode
(
'_'
,
$condition
);
$this
->
data
[
'con_arr'
]
=
$con_arr
;
$where
=
$this
->
_search
(
$condition
);
//
$where = $this->_search($condition);
//每页记录数
$count
=
$this
->
user_building
->
get_user_count
(
$where
);
$count
=
$this
->
manager
->
get_all_count
(
array
(
"role_id"
=>
10
)
);
$this
->
data
[
'count'
]
=
$count
;
$this
->
data
[
'Pintubes'
]
=
$this
->
manager
->
get_all_manager
(
array
(
"role_id"
=>
10
));
//var_dump($this->data['Pintube']);
$this
->
data
[
'condition'
]
=
$condition
;
$this
->
data
[
'page_size'
]
=
self
::
PAGE_SIZE
;
$this
->
data
[
'api'
]
=
site_url
(
'admin/buildingmanageradmin/page_api'
);
$this
->
data
[
'api'
]
=
site_url
(
'admin/buildingmanageradmin/page_api'
);
$this
->
load
->
view
(
'admin/buildingmanager/index'
,
$this
->
data
);
}
...
...
html/application/controllers/admin/report.php
View file @
c153b91f
...
...
@@ -67,10 +67,23 @@ class Report extends CI_Controller
*/
public
function
index
(
$page_no
=
1
)
{
// $this->load->model('sales_model','sales');
// $this->load->helper('eas');
// $api=new easApi;
// $results = $api->newgetCustomerPurchase(array('customer_id'=>'YOM/+vSxTR+Yn99/0GkE0PFxPvM='));
// var_dump($results);
// $results = $api->newgetCustomerVisit(array('customer_id'=>'wb9Np8vHRo+04OTuS6d6DPFxPvM='));
// //var_dump($results[0]["saleManColl"]);
// $checksalesnum='';
// $checksales=$results[0]["saleManColl"];
// foreach($checksales as $value){
//// var_dump($value["id"]);
// $checksalesID=$this->sales->get(array('rongchuang_user_id'=> $value["id"]));
// if(count($checksales,COUNT_NORMAL)>1){
// $checksalesnum.=','.$checksalesID['user_id'];
// }else{
// $checksalesnum=$checksalesID['user_id'];
// }
//
// };
// exit;
$get
=
$this
->
input
->
get
();
...
...
@@ -382,7 +395,11 @@ class Report extends CI_Controller
$dataLog
[
'is_deleted'
]
=
$customerBuilding
[
'is_deleted'
];
$dataLog
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$dataLog
[
'action_time'
]
=
time
();
if
(
$post
[
'userType'
]
==
'sale'
){
$dataLog
[
'remark'
]
=
'分配销售'
;
}
else
{
$dataLog
[
'remark'
]
=
'分配销售经理'
;
}
$this
->
customer_building_log
->
add
(
$dataLog
);
...
...
@@ -481,21 +498,55 @@ class Report extends CI_Controller
$this
->
load
->
model
(
'customer_building_model'
,
'customer_building'
);
$this
->
load
->
model
(
'recommend_trace_model'
,
'recommend'
);
$this
->
load
->
model
(
'customer_building_log_model'
,
'customer_building_log'
);
$this
->
load
->
model
(
'sales_model'
,
'sales'
);
$this
->
load
->
helper
(
'eas'
);
$api
=
new
easApi
;
$customerId
=
$this
->
customer
->
search_rongchuang_id
();
if
(
$customerId
){
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'
]));
//获取返回的sale_id
$checksalesnum
=
''
;
$checksales
=
$results
[
0
][
"saleManColl"
];
foreach
(
$checksales
as
$value
){
$checksalesID
=
$this
->
sales
->
get
(
array
(
'rongchuang_user_id'
=>
$value
[
"id"
]));
if
(
count
(
$checksales
,
COUNT_NORMAL
)
>
1
){
$checksalesnum
.=
','
.
$checksalesID
[
'user_id'
];
}
else
{
$checksalesnum
=
$checksalesID
[
'user_id'
];
}
};
if
(
$customerBuilding
[
'sale_id'
]
!=
$checksalesnum
){
$this
->
customer_building
->
update_customer_building
(
$value
[
'id'
],
array
(
'sale_id'
=>
$checksalesnum
));
$datasales
[
'user_id'
]
=
$customerBuilding
[
'user_id'
];
$datasales
[
'customer_id'
]
=
$customerBuilding
[
'customer_id'
];
$datasales
[
'building_id'
]
=
$customerBuilding
[
'building_id'
];
$datasales
[
'distributor_id'
]
=
$customerBuilding
[
'distributor_id'
];
$datasales
[
'building_title'
]
=
$customerBuilding
[
'building_title'
];
$datasales
[
'sale_id'
]
=
$customerBuilding
[
'sale_id'
];
$datasales
[
'manager_id'
]
=
$customerBuilding
[
'manager_id'
];
$datasales
[
'distribution_status'
]
=
$customerBuilding
[
'distribution_status'
];
$datasales
[
'recommend_status'
]
=
$customerBuilding
[
'recommend_status'
];
$datasales
[
'is_deleted'
]
=
$customerBuilding
[
'is_deleted'
];
$datasales
[
'create_time'
]
=
$customerBuilding
[
'create_time'
];
$datasales
[
'action_time'
]
=
time
();
if
(
$customerBuilding
[
'sale_id'
]
==
0
){
$datasales
[
'remark'
]
=
'分配'
;
}
else
{
$datasales
[
'remark'
]
=
'重新分配'
;
}
$this
->
customer_building_log
->
add
(
$datasales
);
}
if
(
$customerBuilding
[
'recommend_status'
]
<
2
){
$this
->
customer_building
->
update_customer_building
(
$value
[
'id'
],
array
(
'recommend_status'
=>
2
));
}
//记录客户跟进信息
if
(
$customerBuilding
)
{
$dataLog
[
'user_id'
]
=
$customerBuilding
[
'user_id'
];
$dataLog
[
'customer_id'
]
=
$customerBuilding
[
'customer_id'
];
...
...
@@ -556,6 +607,7 @@ class Report extends CI_Controller
$customerId
=
$this
->
customer
->
search_rongchuang_id
();
if
(
$customerId
){
foreach
(
$customerId
as
$value
)
{
//获取返回值
$results
=
$api
->
newgetCustomerPurchase
(
array
(
'customer_id'
=>
$value
[
'rongchuang_id'
]));
if
(
!
empty
(
$results
)){
...
...
html/application/models/customer_building_model.php
View file @
c153b91f
...
...
@@ -143,7 +143,7 @@ class Customer_building_model extends MY_Model{
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_customer C'
,
'C.id = CB.customer_id '
,
'left'
)
->
join
(
'tb_region R'
,
'R.region_code = CB.city_code '
,
'left'
)
->
join
(
'tb_user UP'
,
'UP.id
= CB.sale_id
'
,
'left'
)
->
join
(
'tb_user UP'
,
'UP.id
in ("CB.sale_id")
'
,
'left'
)
->
join
(
'tb_user U'
,
'U.id = CB.user_id'
,
'left'
)
->
join
(
'tb_user TU'
,
'TU.id = CB.manager_id'
,
'left'
)
->
join
(
'tb_distributor D'
,
'D.id = CB.distributor_id'
,
'left'
)
...
...
@@ -226,7 +226,7 @@ class Customer_building_model extends MY_Model{
->
from
(
'tb_customer_building_log CB'
)
->
join
(
'tb_building B'
,
'B.id= CB.building_id'
,
'left'
)
->
join
(
'tb_customer TC'
,
'TC.id = CB.customer_id'
,
'left'
)
->
join
(
'tb_user US'
,
'US.id=
CB.sale_id
'
,
'left'
)
->
join
(
'tb_user US'
,
'US.id=
in(."CB.sale_id".)
'
,
'left'
)
->
join
(
'tb_user UM'
,
'UM.id = CB.manager_id'
,
'left'
)
->
join
(
'tb_user UU'
,
'UU.id = CB.user_id'
,
'left'
)
->
join
(
'tb_distributor D'
,
'D.uniqid_id=UU.uniqid_id'
,
'left'
);
...
...
html/application/models/manager_model.php
View file @
c153b91f
...
...
@@ -93,4 +93,29 @@ class Manager_model extends MY_Model{
}
}
public
function
get_all_count
(
$where
){
$this
->
db
->
select
(
'count(*) total'
)
->
from
(
'tb_manager'
)
->
where
(
$where
);
$query
=
$this
->
db
->
get
();
// echo $this->db->last_query();exit;
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
row_array
();
return
$return
[
'total'
];
}
}
public
function
get_all_manager
(
$where
){
$this
->
db
->
select
(
'M.manager_name manager_name,M.manager_phone manager_phone'
)
->
from
(
'tb_manager M'
)
// ->join('tb_buliding B','B.id = M.building_id','left'
->
where
(
$where
);
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
result_array
();
return
$return
;
}
}
}
\ No newline at end of file
html/application/views/admin/buildingmanager/index.php
View file @
c153b91f
...
...
@@ -49,7 +49,7 @@
</div>
</div>
<div
class=
"girdScroller"
style=
"overflow:auto;"
>
<div
class=
"total"
style=
"margin-bottom:10px;"
>
总共:
<span></span>
条
</div>
<div
class=
"total"
style=
"margin-bottom:10px;"
>
总共:
<span>
<
?php
echo
$count
?>
<
/span>
条
</div>
<table
class=
"table table-striped table-bordered table-hover"
id=
"sample_1"
>
<thead>
<tr>
...
...
@@ -59,6 +59,15 @@
<th>
是否启用
</th>
<th>
操作
</th>
</tr>
<?php
foreach
(
$Pintubes
as
$Pintube
)
:?>
<
tr
>
<
td
><?
php
echo
$Pintube
[
'manager_name'
]
?>
</td>
<td>
<?php
echo
$Pintube
[
'manager_phone'
]
?>
</td>
<td></td>
<td></td>
<td><a
id=
"view"
href=
"javascript:;"
class=
"btn default btn-xs blue"
><i
class=
"fa fa-globe"
></i>
查看
</a></td>
</tr>
<?php
endforeach
?>
</thead>
<tbody
id=
"add-con"
>
</tbody>
...
...
@@ -165,7 +174,8 @@
$
(
document
).
ready
(
function
()
{
var
optInit
=
{
callback
:
pageselectCallback
};
optInit
[
'items_per_page'
]
=
_page_size
;
//console.log(_page_size);
optInit
[
'items_per_page'
]
=
24
;
optInit
[
'next_text'
]
=
"下一页"
;
optInit
[
'num_display_entries'
]
=
5
;
optInit
[
'num_edge_entries'
]
=
2
;
...
...
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