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
39d67a47
Commit
39d67a47
authored
Sep 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分佣表
parent
1a28dd9c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
3 deletions
+51
-3
Finance.php
application/index/controller/Finance.php
+26
-3
OPartialCommission.php
application/model/OPartialCommission.php
+4
-0
ORealIncome.php
application/model/ORealIncome.php
+21
-0
No files found.
application/index/controller/Finance.php
View file @
39d67a47
...
...
@@ -701,15 +701,38 @@ class Finance extends Basic
$where
[
'a.is_del'
]
=
0
;
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$
where
[
'a.confirm_dat
e'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$
income_where
[
'income_tim
e'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$
where
[
'a.confirm_date'
]
=
[
'<= time'
,
$this
->
params
[
'create
_time'
]
.
' 23:59:59'
];
$
income_where
[
'income_time'
]
=
[
'<= time'
,
$this
->
params
[
'end
_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'a.confirm_date'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'create_time'
]
.
' 23:59:59'
]
];
$income_where
[
'income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$income_where
))
{
$m_real
=
new
ORealIncome
();
$bargain_arr
=
$m_real
->
getRealIncomeBargain
(
'bargain_id'
,
$income_where
);
if
(
$bargain_arr
[
'status'
]
==
'successful'
)
{
if
(
empty
(
$bargain_arr
[
'data'
]))
{
return
$this
->
response
(
200
,
''
);
}
foreach
(
$bargain_arr
[
'data'
]
as
$v
)
{
$bargain_id
[]
=
$v
[
'bargain_id'
];
}
if
(
!
empty
(
$bargain_id
))
{
$bargain_id_string
=
implode
(
','
,
$bargain_id
);
$where
[]
=
[
'EXP'
,
'b.id in ('
.
$bargain_id_string
.
') or b.father_id in ('
.
$bargain_id_string
.
')'
];
}
}
else
{
return
$this
->
response
(
101
,
'内部错误:'
.
$bargain_arr
[
'msg'
]);
}
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
...
...
application/model/OPartialCommission.php
View file @
39d67a47
...
...
@@ -78,6 +78,10 @@ class OPartialCommission extends BaseModel
}
$result
[
$k
][
'income_time'
]
=
$m_real
->
where
(
'id'
,
$v
[
'real_income_id'
])
->
value
(
'income_time'
);
if
(
$v
[
'father_id'
]
!=
0
)
{
$result
[
$k
][
'bargain_id'
]
=
$v
[
'father_id'
];
}
}
return
$result
;
}
...
...
application/model/ORealIncome.php
View file @
39d67a47
...
...
@@ -37,4 +37,24 @@ class ORealIncome extends BaseModel
->
select
();
}
/**
* @param string $field
* @param $where
* @return mixed
*/
public
function
getRealIncomeBargain
(
$field
=
'id as fee_id,money,income_time'
,
$where
)
{
try
{
$where
[
'is_del'
]
=
0
;
$result
[
'data'
]
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
();
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
}
\ No newline at end of file
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