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
ef5b4d11
Commit
ef5b4d11
authored
Sep 17, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交报告 约带看 搜索
parent
91f93865
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
56 deletions
+57
-56
Finance.php
application/index/controller/Finance.php
+57
-56
No files found.
application/index/controller/Finance.php
View file @
ef5b4d11
...
...
@@ -102,61 +102,6 @@ class Finance extends Basic
$where
[
'd.shop_type'
]
=
$this
->
params
[
'shop_type'
];
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$agent_where
[
'a.district_id'
]
=
$this
->
params
[
'district_id'
];
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$agent_where
[
'a.store_id'
]
=
$this
->
params
[
'store_id'
];
}
if
(
!
empty
(
$this
->
params
[
'agent_phone'
]))
{
$agent_where
[
'a.phone'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_phone'
]
.
'%'
];
}
if
(
!
empty
(
$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,b.father_id'
,
$agent_where
);
if
(
empty
(
$where_bargain_id
))
{
return
$this
->
response
(
200
,
''
);
}
else
{
$where_id
=
[];
foreach
(
$where_bargain_id
as
$k
=>
$v
)
{
if
(
$v
[
'father_id'
]
==
0
)
{
$where_id
[]
=
$v
[
'id'
];
}
else
{
$where_id
[]
=
$v
[
'father_id'
];
}
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
//分佣方姓名
if
(
!
empty
(
$this
->
params
[
'partial_id'
]))
{
$m_agent
=
new
AAgents
();
$where_bargain_id
=
$m_agent
->
agentBargainAll
(
'b.id,b.father_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
)
{
if
(
$v
[
'father_id'
]
==
0
)
{
$where_id
[]
=
$v
[
'id'
];
}
else
{
$where_id
[]
=
$v
[
'father_id'
];
}
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
$where
[
'a.id'
]
=
$this
->
params
[
'bargain_id'
];
}
...
...
@@ -213,8 +158,64 @@ class Finance extends Basic
$where
[
'a.status'
]
=
20
;
}
$bargain
=
new
OBargainModel
();
try
{
$bargain
=
new
OBargainModel
();
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$agent_where
[
'a.district_id'
]
=
$this
->
params
[
'district_id'
];
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$agent_where
[
'a.store_id'
]
=
$this
->
params
[
'store_id'
];
}
if
(
!
empty
(
$this
->
params
[
'agent_phone'
]))
{
$agent_where
[
'a.phone'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agent_phone'
]
.
'%'
];
}
if
(
!
empty
(
$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
->
getAgentReportBargain
(
'a.id,c.father_id'
,
$agent_where
);
if
(
empty
(
$where_bargain_id
))
{
return
$this
->
response
(
200
,
''
);
}
else
{
$where_id
=
[];
foreach
(
$where_bargain_id
as
$k
=>
$v
)
{
if
(
$v
[
'father_id'
]
==
0
)
{
$where_id
[]
=
$v
[
'id'
];
}
else
{
$where_id
[]
=
$v
[
'father_id'
];
}
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
//分佣方姓名
if
(
!
empty
(
$this
->
params
[
'partial_id'
]))
{
$m_agent
=
new
AAgents
();
$where_bargain_id
=
$m_agent
->
agentBargainAll
(
'b.id,b.father_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
)
{
if
(
$v
[
'father_id'
]
==
0
)
{
$where_id
[]
=
$v
[
'id'
];
}
else
{
$where_id
[]
=
$v
[
'father_id'
];
}
}
$where
[
'a.id'
]
=
[
'in'
,
$where_id
];
}
}
$data
[
'data'
][
'list'
]
=
$bargain
->
getBargainList
(
$pageNo
,
$pageSize
,
$order
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$bargain
->
getBargainTotal
(
$where
);
$data
[
'data'
][
'step'
]
=
$check_status
;
...
...
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