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
692be23e
Commit
692be23e
authored
Jul 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务结单判断
parent
a425126d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
5 deletions
+50
-5
Finance.php
application/index/controller/Finance.php
+7
-1
OBargainModel.php
application/model/OBargainModel.php
+3
-4
OPartialCommission.php
application/model/OPartialCommission.php
+40
-0
No files found.
application/index/controller/Finance.php
View file @
692be23e
...
@@ -1193,7 +1193,6 @@ class Finance extends Basic
...
@@ -1193,7 +1193,6 @@ class Finance extends Basic
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
*/
public
function
checkOver
()
public
function
checkOver
()
{
{
...
@@ -1202,6 +1201,13 @@ class Finance extends Basic
...
@@ -1202,6 +1201,13 @@ class Finance extends Basic
}
}
$m_bargain
=
new
OBargainModel
();
$m_bargain
=
new
OBargainModel
();
$m_partial_commission
=
new
OPartialCommission
();
$confirm_status
=
$m_partial_commission
->
checkConfirmStatus
(
$this
->
params
[
'bargain_id'
]);
if
(
$confirm_status
)
{
return
$this
->
response
(
101
,
'请确认分佣'
);
}
$insert_data
[
'audit_id'
]
=
$this
->
userId
;
$insert_data
[
'audit_id'
]
=
$this
->
userId
;
$insert_data
[
'audit_name'
]
=
$this
->
userName
;
$insert_data
[
'audit_name'
]
=
$this
->
userName
;
...
...
application/model/OBargainModel.php
View file @
692be23e
...
@@ -434,11 +434,10 @@ class OBargainModel extends Model
...
@@ -434,11 +434,10 @@ class OBargainModel extends Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
*/
public
function
addCheckBargain
(
int
$id
,
array
$data
,
int
$source
,
int
$status
)
:
bool
public
function
addCheckBargain
(
int
$id
,
array
$data
,
int
$source
,
int
$status
)
:
bool
{
{
//
$this->startTrans();
$this
->
startTrans
();
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
'id'
=>
$id
,
'status'
=>
[
'in'
,
'10,11'
]
'status'
=>
[
'in'
,
'10,11'
]
...
@@ -492,10 +491,10 @@ class OBargainModel extends Model
...
@@ -492,10 +491,10 @@ class OBargainModel extends Model
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
setField
(
'status'
,
21
);
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
setField
(
'status'
,
21
);
}
}
//
$this->commit();
$this
->
commit
();
$result
=
true
;
$result
=
true
;
}
else
{
}
else
{
//
$this->rollback();
$this
->
rollback
();
$result
=
false
;
$result
=
false
;
}
}
}
else
{
}
else
{
...
...
application/model/OPartialCommission.php
View file @
692be23e
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
namespace
app\model
;
namespace
app\model
;
use
think\Exception
;
class
OPartialCommission
extends
BaseModel
class
OPartialCommission
extends
BaseModel
{
{
protected
$table
=
"o_partial_commission"
;
protected
$table
=
"o_partial_commission"
;
...
@@ -298,4 +300,41 @@ class OPartialCommission extends BaseModel
...
@@ -298,4 +300,41 @@ class OPartialCommission extends BaseModel
->
group
(
'a.agent_id'
)
->
group
(
'a.agent_id'
)
->
count
();
->
count
();
}
}
/**
* 检查是否有未结单分佣
*
* @param $bargain_id
* @return int 0 无 1 有
*/
public
function
checkConfirmStatus
(
$bargain_id
)
{
$result
=
0
;
try
{
$data
=
$this
->
field
(
'confirm_status'
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
where
(
'b.id'
,
$bargain_id
)
->
whereor
(
'b.father_id'
,
$bargain_id
)
->
where
(
'a.is_del'
,
0
)
->
select
();
if
(
empty
(
$data
[
0
][
'confirm_status'
]))
{
$result
=
1
;
}
else
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'confirm_status'
]
==
0
)
{
$result
=
1
;
break
;
}
}
}
}
catch
(
Exception
$e
)
{
$result
=
0
;
}
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