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
3834d08c
Commit
3834d08c
authored
May 31, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改开票税费
parent
984d993e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
OBargainModel.php
application/model/OBargainModel.php
+12
-9
OPartialCommission.php
application/model/OPartialCommission.php
+1
-1
No files found.
application/model/OBargainModel.php
View file @
3834d08c
...
...
@@ -371,7 +371,7 @@ class OBargainModel extends Model
* @param int $id
* @param array $data
* @param int $source 审核来源 1成交报告申请结单 2退款 3申请撤销成交报告
* @param int $status 成交报告状态
10已提交 11审核成功
20待撤销 21已撤销 30删除
* @param int $status 成交报告状态
10已提交 11审核开始 12驳回 13审核成功
20待撤销 21已撤销 30删除
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
...
...
@@ -383,8 +383,8 @@ class OBargainModel extends Model
$this
->
startTrans
();
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
'status'
=>
$status
])
->
lock
(
true
)
->
find
();
'status'
=>
[
'in'
,
'10,11'
]
])
->
find
();
if
(
$bargain_data
!=
''
)
{
$audit
=
new
OFinancialAudit
();
...
...
@@ -433,10 +433,10 @@ class OBargainModel extends Model
$this
->
where
(
'id'
,
$bargain_data
[
'id'
])
->
setField
(
'status'
,
21
);
}
$this
->
commit
();
//
$this->commit();
$result
=
true
;
}
else
{
$this
->
rollback
();
//
$this->rollback();
$result
=
false
;
}
}
else
{
...
...
@@ -797,14 +797,17 @@ class OBargainModel extends Model
{
$m_partial
=
new
OPartialCommission
();
$
data
=
$m_partial
->
getBragainScale
(
$bargain_id
);
$
partial_bargain
=
$m_partial
->
getBragainScale
(
$bargain_id
);
if
(
empty
(
$data
))
{
$data
=
$this
->
field
(
'role,agent_id,scale,scale_fee'
)
foreach
(
$partial_bargain
as
$val
)
{
$bargain_id_arr
[]
=
$val
[
'bargain_id'
];
}
$data
=
$this
->
field
(
'role,agent_id,scale,scale_fee'
)
->
where
(
'id'
,
$bargain_id
)
->
where
(
'id'
,
'not in'
,
import
(
','
,
$bargain_id_arr
))
->
whereOr
(
'father_id'
,
$bargain_id
)
->
select
();
}
$m_agent
=
new
AAgents
();
$result
=
[];
...
...
application/model/OPartialCommission.php
View file @
3834d08c
...
...
@@ -197,7 +197,7 @@ class OPartialCommission extends BaseModel
* @throws \think\exception\PDOException
*/
public
function
getBragainScale
(
int
$bargain_id
)
{
$sql
=
'SELECT a.
scal
e,a.agent_id,a.role,substring_index(group_concat(a.id ORDER BY a.id DESC),",",1) AS id
$sql
=
'SELECT a.
bargain_id,a.scale,b.scale_fe
e,a.agent_id,a.role,substring_index(group_concat(a.id ORDER BY a.id DESC),",",1) AS id
FROM o_partial_commission a LEFT JOIN o_bargain b on a.bargain_id=b.id WHERE a.bargain_id = '
.
$bargain_id
.
'
and b.id= '
.
$bargain_id
.
' OR b.father_id='
.
$bargain_id
.
' GROUP BY role'
;
return
$this
->
query
(
$sql
);
...
...
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