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
c889d6c8
Commit
c889d6c8
authored
Sep 10, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交报告搜索
parent
204e46ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
15 deletions
+56
-15
OrderLog.php
application/api_broker/controller/OrderLog.php
+1
-1
Finance.php
application/index/controller/Finance.php
+35
-8
AAgents.php
application/model/AAgents.php
+19
-1
GHousesToAgents.php
application/model/GHousesToAgents.php
+1
-1
OBargainModel.php
application/model/OBargainModel.php
+0
-4
No files found.
application/api_broker/controller/OrderLog.php
View file @
c889d6c8
...
...
@@ -806,7 +806,7 @@ class OrderLog extends Basic
if
(
!
empty
(
$where
))
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentB
ra
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time'
,
[
'b.id'
=>
$bargain_id
]);
$agent_data
=
$m_agent
->
agentB
ar
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time'
,
[
'b.id'
=>
$bargain_id
]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
...
...
application/index/controller/Finance.php
View file @
c889d6c8
...
...
@@ -67,7 +67,8 @@ class Finance extends Basic
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$check_status
=
$this
->
params
[
'check_status'
];
$fields
=
'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number,a.is_open,a.agent_id'
;
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number,a.is_open,a.agent_id,
a.submit_agent_name,a.price'
;
$where
[
'a.father_id'
]
=
0
;
$where
[
'a.status'
]
=
11
;
$order
=
'a.id desc'
;
...
...
@@ -102,24 +103,50 @@ class Finance extends Basic
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$
where
[
'f
.district_id'
]
=
$this
->
params
[
'district_id'
];
$
agent_where
[
'a
.district_id'
]
=
$this
->
params
[
'district_id'
];
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$
where
[
'f
.store_id'
]
=
$this
->
params
[
'store_id'
];
$
agent_where
[
'a
.store_id'
]
=
$this
->
params
[
'store_id'
];
}
if
(
!
empty
(
$this
->
params
[
'agent_phone'
]))
{
$
where
[
'f
.phone'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_phone'
]
.
'%'
];
$
agent_where
[
'a
.phone'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'agent_name'
]))
{
$where
[
'f.name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_name'
]
.
'%'
];
$agent_where
[
'a.name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_name'
]
.
'%'
];
}
if
(
!
empty
(
$agent_where
))
{
$m_agent
=
new
AAgents
();
$where_bargain_id
=
$m_agent
->
agentBargainAll
(
'b.id'
,
$agent_where
);
if
(
empty
(
$where_bargain_id
))
{
return
$this
->
response
(
200
,
''
);
}
else
{
$where_id
=
[];
foreach
(
$where_bargain_id
as
$k
=>
$v
)
{
$where_id
[]
=
$v
[
'id'
];
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
//分佣方姓名
if
(
!
empty
(
$this
->
params
[
'partial_name'
]))
{
$where
[
'g.name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'partial_name'
]
.
'%'
];
if
(
!
empty
(
$this
->
params
[
'partial_id'
]))
{
$m_agent
=
new
AAgents
();
$where_bargain_id
=
$m_agent
->
agentBargainAll
(
'b.id'
,
[
'a.id'
=>
$this
->
params
[
'partial_id'
]]);
if
(
empty
(
$where_bargain_id
))
{
return
$this
->
response
(
200
,
''
);
}
else
{
$where_id
=
[];
foreach
(
$where_bargain_id
as
$k
=>
$v
)
{
$where_id
[]
=
$v
[
'id'
];
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
...
...
@@ -1585,7 +1612,7 @@ class Finance extends Basic
if
(
!
empty
(
$where
))
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentB
ra
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time'
,
[
'b.id'
=>
$bargain_id
]);
$agent_data
=
$m_agent
->
agentB
ar
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time'
,
[
'b.id'
=>
$bargain_id
]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
...
...
application/model/AAgents.php
View file @
c889d6c8
...
...
@@ -1114,7 +1114,7 @@ class AAgents extends BaseModel
* @param $where
* @return array|false|\PDOStatement|string|\think\Model
*/
public
function
agentB
ra
gainDetail
(
$field
,
$where
)
{
public
function
agentB
ar
gainDetail
(
$field
,
$where
)
{
try
{
$data
=
$this
->
alias
(
'a'
)
->
field
(
$field
)
...
...
@@ -1127,6 +1127,24 @@ class AAgents extends BaseModel
return
$data
;
}
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
agentBargainAll
(
$field
,
$where
)
{
try
{
$data
=
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_bargain b'
,
'a.id = b.agent_id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
[];
}
return
$data
;
}
/**
* 获取绑定号码
*
...
...
application/model/GHousesToAgents.php
View file @
c889d6c8
...
...
@@ -123,7 +123,7 @@ class GHousesToAgents extends BaseModel
foreach
(
$agent_id
as
$k
=>
$v
)
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentB
ra
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time,a.name'
,
[
'a.id'
=>
$v
]);
$agent_data
=
$m_agent
->
agentB
ar
gainDetail
(
'a.id,a.store_id,a.district_id,b.create_time,a.name'
,
[
'a.id'
=>
$v
]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
...
...
application/model/OBargainModel.php
View file @
c889d6c8
...
...
@@ -361,8 +361,6 @@ class OBargainModel extends Model
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents f'
,
'b.report_agent_id=f.id'
,
'left'
)
->
join
(
'a_agents g'
,
'a.agent_id=g.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
order
(
$order_
)
...
...
@@ -383,8 +381,6 @@ class OBargainModel extends Model
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_order c'
,
'a.order_id = c.id'
,
'left'
)
->
join
(
'g_houses d'
,
'c.house_id = d.id'
,
'left'
)
->
join
(
'a_agents f'
,
'b.report_agent_id=f.id'
,
'left'
)
->
join
(
'a_agents g'
,
'a.agent_id=g.id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
...
...
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