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
addba98e
Commit
addba98e
authored
Jun 28, 2017
by
html5-李恒逸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改:分销商绑定时,过滤掉已经绑定的楼盘
parent
3e01f604
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
report.php
html/application/controllers/admin/report.php
+1
-1
building_distributor_model.php
html/application/models/building_distributor_model.php
+11
-11
No files found.
html/application/controllers/admin/report.php
View file @
addba98e
...
@@ -1064,7 +1064,7 @@ class Report extends CI_Controller
...
@@ -1064,7 +1064,7 @@ class Report extends CI_Controller
$where
.=
' and b.id in('
.
$info
[
'building_id'
]
.
')'
;
//echo $where;die;
$where
.=
' and b.id in('
.
$info
[
'building_id'
]
.
')'
;
//echo $where;die;
$all_result
=
$this
->
relate
->
get_unbind_list
(
trim
(
$where
));
//查询所有的笛卡尔积(项目*分销商)
$all_result
=
$this
->
relate
->
get_unbind_list
(
trim
(
$where
));
//查询所有的笛卡尔积(项目*分销商)
$has_result
=
$this
->
relate
->
get_bind_list
(
$
uid
);
//查询已经绑定此销管的分销商
$has_result
=
$this
->
relate
->
get_bind_list
(
$
info
[
'building_id'
]
);
//查询已经绑定此销管的分销商
if
(
$all_result
)
{
if
(
$all_result
)
{
foreach
(
$all_result
as
$key
=>
$all
)
{
foreach
(
$all_result
as
$key
=>
$all
)
{
...
...
html/application/models/building_distributor_model.php
View file @
addba98e
<?php
<?php
/**
/**
* 分销商与销管关系模型
* 分销商与销管关系模型
*
*
* @package application/model
* @package application/model
* @version 2012-10-31
* @version 2012-10-31
* @author wenhuijang
* @author wenhuijang
...
@@ -11,18 +11,18 @@ class Building_distributor_model extends MY_Model{
...
@@ -11,18 +11,18 @@ class Building_distributor_model extends MY_Model{
//定义用到的数据库表
//定义用到的数据库表
public
$table
=
'tb_building_distributor_relate'
;
public
$table
=
'tb_building_distributor_relate'
;
public
function
__construct
(){
public
function
__construct
(){
parent
::
__construct
();
parent
::
__construct
();
$this
->
db
=
$this
->
load
->
database
(
'default'
,
true
);
$this
->
db
=
$this
->
load
->
database
(
'default'
,
true
);
}
}
/**
/**
*
*
* 查询所有数据
* 查询所有数据
* @param int $where
* @param int $where
* @return array 包含统计起止时间的数组
* @return array 包含统计起止时间的数组
* @throws Exception
* @throws Exception
* @author wenhuijang
* @author wenhuijang
* @version 2014-09-09
* @version 2014-09-09
*/
*/
...
@@ -34,7 +34,7 @@ class Building_distributor_model extends MY_Model{
...
@@ -34,7 +34,7 @@ class Building_distributor_model extends MY_Model{
->
join
(
'tb_manager M'
,
'M.id = R.user_id'
)
->
join
(
'tb_manager M'
,
'M.id = R.user_id'
)
->
join
(
'tb_building B'
,
'B.id = R.building_id'
);
->
join
(
'tb_building B'
,
'B.id = R.building_id'
);
if
(
!
empty
(
$where
))
if
(
!
empty
(
$where
))
{
{
$this
->
db
->
where
(
$where
);
$this
->
db
->
where
(
$where
);
...
@@ -91,11 +91,11 @@ class Building_distributor_model extends MY_Model{
...
@@ -91,11 +91,11 @@ class Building_distributor_model extends MY_Model{
}
}
/**
/**
*
*
* 查询所有楼盘数据
* 查询所有楼盘数据
* @param int $where
* @param int $where
* @return array 包含统计起止时间的数组
* @return array 包含统计起止时间的数组
* @throws Exception
* @throws Exception
* @author wenhuijang
* @author wenhuijang
* @version 2014-09-09
* @version 2014-09-09
*/
*/
...
@@ -106,7 +106,7 @@ class Building_distributor_model extends MY_Model{
...
@@ -106,7 +106,7 @@ class Building_distributor_model extends MY_Model{
->
join
(
'tb_distributor D'
,
'D.id = R.distributor_id'
)
->
join
(
'tb_distributor D'
,
'D.id = R.distributor_id'
)
->
join
(
'tb_building B'
,
'B.id = R.building_id'
)
->
join
(
'tb_building B'
,
'B.id = R.building_id'
)
->
join
(
'tb_region RE'
,
'RE.region_code=B.region_code'
);
->
join
(
'tb_region RE'
,
'RE.region_code=B.region_code'
);
if
(
!
empty
(
$where
))
if
(
!
empty
(
$where
))
{
{
...
@@ -116,7 +116,7 @@ class Building_distributor_model extends MY_Model{
...
@@ -116,7 +116,7 @@ class Building_distributor_model extends MY_Model{
$this
->
db
->
order_by
(
'R.id'
,
'desc'
);
$this
->
db
->
order_by
(
'R.id'
,
'desc'
);
$query
=
$this
->
db
->
get
(
null
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
$query
=
$this
->
db
->
get
(
null
,
$page_size
,
(
$page
-
1
)
*
$page_size
);
if
(
$query
->
num_rows
()
>
0
)
if
(
$query
->
num_rows
()
>
0
)
{
{
$return
=
$query
->
result_array
();
$return
=
$query
->
result_array
();
...
@@ -174,9 +174,9 @@ class Building_distributor_model extends MY_Model{
...
@@ -174,9 +174,9 @@ class Building_distributor_model extends MY_Model{
}
}
//查询已经绑定此销管的分销商
//查询已经绑定此销管的分销商
public
function
get_bind_list
(
$
manager
_id
=
''
)
public
function
get_bind_list
(
$
building
_id
=
''
)
{
{
$query
=
$this
->
db
->
query
(
'SELECT distributor_id,building_id from tb_building_distributor_relate WHERE
user_id ='
.
$manager_id
);
$query
=
$this
->
db
->
query
(
'SELECT distributor_id,building_id from tb_building_distributor_relate WHERE
building_id in ('
.
$building_id
.
')'
);
if
(
$query
->
num_rows
()
>
0
)
if
(
$query
->
num_rows
()
>
0
)
{
{
...
...
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