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
89c11cf5
Commit
89c11cf5
authored
Aug 16, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改审核判断逻辑
parent
77cab82e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
Finance.php
application/index/controller/Finance.php
+3
-10
OBargainModel.php
application/model/OBargainModel.php
+2
-2
OFinancialAudit.php
application/model/OFinancialAudit.php
+36
-0
No files found.
application/index/controller/Finance.php
View file @
89c11cf5
...
...
@@ -1517,18 +1517,11 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'参数错误'
);
}
$params
[
'content'
]
=
trim
(
$this
->
params
[
'content'
]);
//撤销原因
$m_financial
=
new
OFinancialAudit
();
$data
[
'status'
]
=
4
;
$data
[
'is_del'
]
=
1
;
//去除之前的审核记录
$data
=
$m_financial
->
editData
(
$data
,
$this
->
params
[
'bargain_id'
],
'bargain_id'
);
$result
=
$m_financial
->
backOutUpdate
(
$this
->
params
[
'bargain_id'
],
$params
);
$m_bargain
=
new
OBargainModel
();
$update_data
[
'status'
]
=
20
;
$update_data
[
'audit_level'
]
=
0
;
$update_data
[
'content'
]
=
$this
->
params
[
'content'
];
//撤销原因
$m_bargain
->
updateBargain
(
$this
->
params
[
'bargain_id'
],
$update_data
);
if
(
$data
>
0
)
{
if
(
$result
)
{
$code
=
200
;
$this
->
editRecordLog
(
$this
->
params
[
'bargain_id'
],
'[撤销成交报告]'
,
3
);
//日志记录
$msg
=
'撤销成功'
;
...
...
application/model/OBargainModel.php
View file @
89c11cf5
...
...
@@ -425,7 +425,7 @@ class OBargainModel extends Model
$update_data
[
'account_time'
]
=
date
(
'Y-m-d H:i:s'
);
}
else
{
//记录第几级审核-与 OFinancialAudit 表一致
$update_data
[
'audit_level'
]
=
$
save_
data
[
'audit_level'
];
$update_data
[
'audit_level'
]
=
$data
[
'audit_level'
];
}
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
whereOr
(
'father_id'
,
$bargain_data
[
'id'
])
->
update
(
$update_data
);
$this
->
commit
();
...
...
@@ -1330,7 +1330,7 @@ class OBargainModel extends Model
if
(
$id
)
{
$result
=
$this
->
where
(
'id'
,
$id
)
->
whereOr
(
'father_id'
,
$id
)
->
insertGetId
(
$data
);
->
update
(
$data
);
}
else
{
$result
=
0
;
}
...
...
application/model/OFinancialAudit.php
View file @
89c11cf5
...
...
@@ -67,4 +67,39 @@ class OFinancialAudit extends BaseModel
return
0
;
}
}
/**
* 撤销数据
*
* @param int $bargain_id
* @param array $params
* @return bool
* @throws \think\exception\PDOException
*/
public
function
backOutUpdate
(
int
$bargain_id
,
array
$params
=
[])
:
bool
{
if
(
empty
(
$bargain_id
))
{
return
false
;
}
$this
->
startTrans
();
$data
[
'status'
]
=
4
;
$data
[
'is_del'
]
=
1
;
//去除之前的审核记录
$result_audit
=
$this
->
editData
(
$data
,
$bargain_id
,
'bargain_id'
);
$m_bargain
=
new
OBargainModel
();
$update_data
[
'status'
]
=
20
;
$update_data
[
'audit_level'
]
=
0
;
$update_data
[
'content'
]
=
$params
[
'content'
];
//撤销原因
$result_bargain
=
$m_bargain
->
updateBargain
(
$bargain_id
,
$update_data
);
if
(
$result_bargain
)
{
$this
->
commit
();
$result
=
true
;
}
else
{
$this
->
rollback
();
$result
=
false
;
}
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