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
e496463d
Commit
e496463d
authored
Jun 26, 2017
by
HTML5-侯张振
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新接口更改
parent
07225ff4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
8 deletions
+62
-8
report.php
html/application/controllers/admin/report.php
+18
-6
customer_building_model.php
html/application/models/customer_building_model.php
+43
-1
index_info.php
html/application/views/admin/report/index_info.php
+1
-1
No files found.
html/application/controllers/admin/report.php
View file @
e496463d
...
@@ -131,8 +131,12 @@ class Report extends CI_Controller
...
@@ -131,8 +131,12 @@ class Report extends CI_Controller
$this
->
data
[
'count'
]
=
$count
;
$this
->
data
[
'count'
]
=
$count
;
$customers
=
$this
->
customer_building
->
get_report_list
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
$customers
=
$this
->
customer_building
->
get_report_list
(
$where
,
$page_no
,
self
::
PAGE_SIZE
);
// echo '<pre>';
//$salewhere = $customers['cid'];
// print_r($customers);die;
$salearray
=
array
();
foreach
(
$customers
as
$i
=>
$sale
){
$customers
[
$i
][
'Strue_name'
]
=
$this
->
customer_building
->
get_report_salelist
(
$sale
[
'id'
]);
}
//echo '<pre>';print_r($customers);die;
if
(
$customers
)
{
if
(
$customers
)
{
//查找楼盘的经理和销售员关系
//查找楼盘的经理和销售员关系
...
@@ -502,6 +506,7 @@ class Report extends CI_Controller
...
@@ -502,6 +506,7 @@ class Report extends CI_Controller
$this
->
load
->
model
(
'recommend_trace_model'
,
'recommend'
);
$this
->
load
->
model
(
'recommend_trace_model'
,
'recommend'
);
$this
->
load
->
model
(
'customer_building_log_model'
,
'customer_building_log'
);
$this
->
load
->
model
(
'customer_building_log_model'
,
'customer_building_log'
);
$this
->
load
->
model
(
'sales_model'
,
'sales'
);
$this
->
load
->
model
(
'sales_model'
,
'sales'
);
$this
->
load
->
model
(
'customer_sales_model'
,
'customer_sales'
);
$this
->
load
->
helper
(
'eas'
);
$this
->
load
->
helper
(
'eas'
);
$api
=
new
easApi
;
$api
=
new
easApi
;
$customerId
=
$this
->
customer
->
search_rongchuang_id
();
$customerId
=
$this
->
customer
->
search_rongchuang_id
();
...
@@ -515,18 +520,25 @@ class Report extends CI_Controller
...
@@ -515,18 +520,25 @@ class Report extends CI_Controller
$customerBuilding
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$entity_id
[
'id'
]));
$customerBuilding
=
$this
->
customer_building
->
get
(
array
(
'id'
=>
$entity_id
[
'id'
]));
//获取返回的sale_id
//获取返回的sale_id
$checksalesnum
=
''
;
$checksalesnum
=
array
()
;
$checksales
=
$results
[
0
][
"saleManColl"
];
$checksales
=
$results
[
0
][
"saleManColl"
];
foreach
(
$checksales
as
$value
){
foreach
(
$checksales
as
$value
){
$checksalesID
=
$this
->
sales
->
get
(
array
(
'rongchuang_user_id'
=>
$value
[
"id"
]));
$checksalesID
=
$this
->
sales
->
get
(
array
(
'rongchuang_user_id'
=>
$value
[
"id"
]));
if
(
count
(
$checksales
,
COUNT_NORMAL
)
>
1
){
if
(
count
(
$checksales
,
COUNT_NORMAL
)
>
1
){
$checksalesnum
.=
','
.
$checksalesID
[
'user_id'
];
$checksalesnum
[]
=
$checksalesID
[
'user_id'
];
}
else
{
}
else
{
$checksalesnum
=
$checksalesID
[
'user_id'
];
$checksalesnum
=
$checksalesID
[
'user_id'
];
}
}
};
};
if
(
$customerBuilding
[
'sale_id'
]
!=
$checksalesnum
){
$customer_sales_id
=
$this
->
customer_building
->
get_sale_id
(
array
(
'customer_building_id'
=>
$customerBuilding
[
'id'
]));
$this
->
customer_building
->
update_customer_building
(
$value
[
'id'
],
array
(
'sale_id'
=>
$checksalesnum
));
if
(
!
(
$customer_sales_id
==
$checksalesnum
)){
$this
->
customer_sales
->
delete_sale_id
(
array
(
'customer_building_id'
=>
$customerBuilding
[
'id'
]));
foreach
(
$checksalesnum
as
$checksales
){
$customer_sales
[
'customer_building_id'
]
=
$customerBuilding
[
'id'
];
$customer_sales
[
'sale_id'
]
=
$checksales
[
'user_id'
];
$customer_sales
[
'create_time'
]
=
timer
();
$this
->
customer_sales
->
add
(
$customer_sales
);
}
$datasales
[
'user_id'
]
=
$customerBuilding
[
'user_id'
];
$datasales
[
'user_id'
]
=
$customerBuilding
[
'user_id'
];
$datasales
[
'customer_id'
]
=
$customerBuilding
[
'customer_id'
];
$datasales
[
'customer_id'
]
=
$customerBuilding
[
'customer_id'
];
$datasales
[
'building_id'
]
=
$customerBuilding
[
'building_id'
];
$datasales
[
'building_id'
]
=
$customerBuilding
[
'building_id'
];
...
...
html/application/models/customer_building_model.php
View file @
e496463d
...
@@ -143,7 +143,8 @@ class Customer_building_model extends MY_Model{
...
@@ -143,7 +143,8 @@ class Customer_building_model extends MY_Model{
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_building B'
,
'B.id = CB.building_id '
,
'left'
)
->
join
(
'tb_customer C'
,
'C.id = CB.customer_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_region R'
,
'R.region_code = CB.city_code '
,
'left'
)
->
join
(
'tb_user UP'
,
'UP.id in ("CB.sale_id")'
,
'left'
)
// ->join('tb_customer_sales US', 'US.customer_building_id = CB.id', 'left')
->
join
(
'tb_user UP'
,
'UP.id = CB.sale_id'
,
'left'
)
->
join
(
'tb_user U'
,
'U.id = CB.user_id'
,
'left'
)
->
join
(
'tb_user U'
,
'U.id = CB.user_id'
,
'left'
)
->
join
(
'tb_user TU'
,
'TU.id = CB.manager_id'
,
'left'
)
->
join
(
'tb_user TU'
,
'TU.id = CB.manager_id'
,
'left'
)
->
join
(
'tb_distributor D'
,
'D.id = CB.distributor_id'
,
'left'
)
->
join
(
'tb_distributor D'
,
'D.id = CB.distributor_id'
,
'left'
)
...
@@ -169,6 +170,47 @@ class Customer_building_model extends MY_Model{
...
@@ -169,6 +170,47 @@ class Customer_building_model extends MY_Model{
}
}
return
array
();
return
array
();
}
}
public
function
get_report_salelist
(
$where
=
''
)
{
$this
->
db
->
distinct
()
->
select
(
'UP.true_name Strue_name'
)
->
from
(
'tb_customer_building CB'
)
->
join
(
'tb_customer_sales US'
,
'US.customer_building_id = CB.id'
,
'left'
)
->
join
(
'tb_user UP'
,
'UP.id = US.sale_id'
,
'left'
);
if
(
!
empty
(
$where
))
{
$this
->
db
->
where
(
'CB.id ='
.
$where
);
}
$this
->
db
->
order_by
(
'CB.id'
,
'desc'
);
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
result_array
();
return
$return
;
}
return
array
();
}
//获取sale_id
public
function
get_sale_id
(
$where
){
$this
->
db
->
select
(
'CS.sale_id'
)
->
from
(
'tb_customer_sales CS'
)
->
where
(
$where
);
$query
=
$this
->
db
->
get
();
if
(
$query
->
num_rows
()
>
0
)
{
$return
=
$query
->
result_array
();
return
$return
;
}
return
array
();
}
//二次报备列表
//二次报备列表
public
function
get_reportagain_list
(
$where
=
''
,
$page
=
1
,
$page_size
=
10
,
$order
=
NULL
)
public
function
get_reportagain_list
(
$where
=
''
,
$page
=
1
,
$page_size
=
10
,
$order
=
NULL
)
{
{
...
...
html/application/views/admin/report/index_info.php
View file @
e496463d
...
@@ -280,7 +280,7 @@
...
@@ -280,7 +280,7 @@
<?php
}
else
{
?>
<?php
}
else
{
?>
<td>
已过期
</td>
<td>
已过期
</td>
<?php
}
?>
<?php
}
?>
<td>
<?php
echo
$customer
[
'Strue_name'
];
?>
</td>
<td>
<?php
foreach
(
$customer
[
'Strue_name'
]
as
$i
=>
$sale
)
:?><?
php
if
(
$i
==
0
||
$customer
[
'Strue_name'
][
$i
][
'Strue_name'
]
==
''
){
?><?php
echo
$customer
[
'Strue_name'
][
$i
][
'Strue_name'
]
?><?php
}
else
{
?><?php
echo
","
.
$customer
[
'Strue_name'
][
$i
][
'Strue_name'
]
?><?php
}
?><?php
endforeach
?>
</td>
<td>
<?php
echo
$customer
[
'Mtrue_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'Mtrue_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'agent_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'agent_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'channel_name'
];
?>
</td>
<td>
<?php
echo
$customer
[
'channel_name'
];
?>
</td>
...
...
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