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
bec8db81
Commit
bec8db81
authored
Mar 14, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务成交报告审核
parent
5da837b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
4 deletions
+94
-4
Finance.php
application/index/controller/Finance.php
+36
-4
OBargainModel.php
application/model/OBargainModel.php
+57
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Finance.php
View file @
bec8db81
...
...
@@ -30,16 +30,20 @@ class Finance extends Basic
$data
[
'data'
]
=
[];
if
(
$this
->
request
->
isGet
())
{
$pageNo
=
empty
(
$
_POST
[
'pageNo'
])
?
1
:
$_POST
[
'pageNo'
];
$pageSize
=
empty
(
$
_POST
[
'pageSize'
])
?
15
:
$_POST
[
'pageSize'
];
$pageNo
=
empty
(
$
this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$
this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$fields
=
'a.id,a.create_time,b.user_phone,b.user_name,d.internal_title,d.internal_address,a.commission,a.practical_fee'
;
$where
[
'a.father_id'
]
=
0
;
$where
[
'c.is_del'
]
=
0
;
$where
[
'a.check_status'
]
=
0
;
if
(
!
empty
(
$this
->
params
[
'check_status'
]))
{
$where
[
'a.check_status'
]
=
$this
->
params
[
'check_status'
];
}
$bargain
=
new
OBargainModel
();
$data
[
'data'
]
=
$bargain
->
getBargain
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
}
else
{
}
$result
=
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
else
{
...
...
@@ -49,6 +53,34 @@ class Finance extends Basic
return
$result
;
}
/**
* 成交报告审核
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
checkReport
()
{
$data
[
'code'
]
=
200
;
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
$bargain
=
new
OBargainModel
();
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'check_status'
]))
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'id is null'
;
}
else
{
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$this
->
params
[
'check_status'
]);
if
(
empty
(
$status
))
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'审核失败'
;
}
}
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
* 退款审核
*
...
...
application/model/OBargainModel.php
View file @
bec8db81
...
...
@@ -188,4 +188,60 @@ class OBargainModel extends Model
->
select
();
}
/**
* 成交报告审核
*
* @param $id
* @param $check_status
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
addCheckBargain
(
$id
,
$check_status
)
{
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
'status'
=>
10
])
->
lock
(
true
)
->
find
();
if
(
$bargain_data
!=
''
)
{
$bargain_data
[
'check_status'
]
=
$check_status
;
$this
->
save
([
'check_status'
=>
$check_status
],
[
'id'
=>
$bargain_data
[
'id'
]]);
$check_data
=
[];
switch
(
$check_status
)
{
case
20
:
$check_data
[
'rule'
]
=
'经理'
;
break
;
case
30
:
$check_data
[
'rule'
]
=
'总监'
;
break
;
case
40
:
$check_data
[
'rule'
]
=
'出纳'
;
break
;
default
:
$check_data
[
'rule'
]
=
'专员'
;
}
$check_data
[
'bargain_id'
]
=
$bargain_data
[
'id'
];
$check_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$check_data
[
'agent_id'
]
=
$bargain_data
[
'agent_id'
];
$check_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$check_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
Db
::
table
(
'o_check_bargain'
)
->
insert
(
$check_data
);
$check_bargain_id
=
Db
::
table
(
'o_check_bargain'
)
->
getLastInsID
();
if
(
$check_bargain_id
)
{
$this
->
commit
();
$result
=
true
;
}
else
{
$this
->
rollback
();
$result
=
false
;
}
}
else
{
$result
=
false
;
}
return
$result
;
}
}
\ No newline at end of file
application/route.php
View file @
bec8db81
...
...
@@ -169,6 +169,7 @@ Route::group('index', [
'reportList'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get|post'
]
],
//财务 成交报告
'refundList'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
]
],
//财务 退款
'accountList'
=>
[
'index/Finance/accountList'
,
[
'method'
=>
'get|post'
]
],
//财务 账户列表
'checkReport'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
]
],
//财务审核成交报告
]);
...
...
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