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
06569a88
Commit
06569a88
authored
Mar 22, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新成交报告审核
parent
8b1fb6d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
29 deletions
+91
-29
Finance.php
application/index/controller/Finance.php
+7
-3
OBargainModel.php
application/model/OBargainModel.php
+30
-25
OFinancialAudit.php
application/model/OFinancialAudit.php
+50
-0
route.php
application/route.php
+4
-1
No files found.
application/index/controller/Finance.php
View file @
06569a88
...
...
@@ -68,7 +68,6 @@ class Finance extends Basic
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
checkReport
()
{
$data
[
'code'
]
=
200
;
...
...
@@ -76,11 +75,16 @@ class Finance extends Basic
$data
[
'data'
]
=
[];
$bargain
=
new
OBargainModel
();
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'check_status'
])
)
{
if
(
empty
(
$this
->
params
[
'id'
]))
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Id or check_status is null'
;
}
else
{
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$this
->
params
[
'check_status'
]);
$params
[
'audit_id'
]
=
$this
->
userId
;
$params
[
'audit_name'
]
=
$this
->
userName
;
$params
[
'audit_id'
]
=
$this
->
userId
;
$params
[
'audit_level'
]
=
$this
->
params
[
'check_status'
];
$params
[
'remark'
]
=
$this
->
params
[
'remark'
];
$status
=
$bargain
->
addCheckBargain
(
$this
->
params
[
'id'
],
$params
);
if
(
empty
(
$status
))
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'审核失败'
;
...
...
application/model/OBargainModel.php
View file @
06569a88
...
...
@@ -209,14 +209,13 @@ class OBargainModel extends Model
* 成交报告审核
*
* @param $id
* @param $
check_status
* @return bool
* @param $
data
* @return bool
|false|int
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
addCheckBargain
(
$id
,
$
check_status
)
{
public
function
addCheckBargain
(
$id
,
$
data
)
{
$bargain_data
=
$this
->
field
(
'id,report_id,agent_id,order_no,order_id'
)
->
where
([
'id'
=>
$id
,
...
...
@@ -224,30 +223,36 @@ class OBargainModel extends Model
])
->
lock
(
true
)
->
find
();
if
(
$bargain_data
!=
''
)
{
$
bargain_data
[
'check_status'
]
=
$check_status
;
$
this
->
save
([
'check_status'
=>
$check_status
],
[
'id'
=>
$bargain_data
[
'id'
]
]);
$
audit
=
new
OFinancialAudit
()
;
$
audit_data
=
$audit
->
getLastStep
(
$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'
]
=
'专员'
;
}
$save_data
[
'bargain_id'
]
=
$bargain_data
[
'id'
];
$save_data
[
'agent_id'
]
=
$bargain_data
[
'agent_id'
];
$save_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$save_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$save_data
[
'source'
]
=
1
;
$save_data
[
'status'
]
=
1
;
$save_data
[
'remark'
]
=
$data
[
'remark'
];
$save_data
[
'audit_id'
]
=
$data
[
'audit_id'
];
$save_data
[
'audit_name'
]
=
$data
[
'audit_name'
];
$return
=
0
;
$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'
];
//是否有审核记录,只做一次审核。
if
(
isset
(
$audit_data
[
'id'
]))
{
//第二、三、四审核
if
(
$audit_data
[
'audit_level'
]
==
(
$data
[
'audit_level'
]
-
1
))
{
$save_data
[
'audit_level'
]
=
$data
[
'audit_level'
];
$return
=
$audit
->
addAudit
(
$save_data
);
}
}
else
{
//第一步审核
if
(
$data
[
'audit_level'
]
===
"0"
)
{
$save_data
[
'audit_level'
]
=
0
;
$return
=
$audit
->
addAudit
(
$save_data
);
}
}
Db
::
table
(
'o_check_bargain'
)
->
insert
(
$check_data
);
$check_bargain_id
=
Db
::
table
(
'o_check_bargain'
)
->
getLastInsID
();
if
(
$check_bargain_id
)
{
if
(
$return
)
{
$this
->
commit
();
$result
=
true
;
}
else
{
...
...
application/model/OFinancialAudit.php
0 → 100644
View file @
06569a88
<?php
/**
* Created by PhpStorm.
* User: hujun
* Date: 2018/3/22
* Time: 15:25
*/
namespace
app\model
;
class
OFinancialAudit
extends
BaseModel
{
/**
* 添加审核通过记录
*
* @param $data
* @return false|int
*/
public
function
addAudit
(
$data
)
{
$save_data
[
'bargain_id'
]
=
$data
[
'bargain_id'
];
$save_data
[
'agent_id'
]
=
$data
[
'agent_id'
];
$save_data
[
'order_no'
]
=
$data
[
'order_no'
];
$save_data
[
'order_id'
]
=
$data
[
'order_id'
];
$save_data
[
'source'
]
=
$data
[
'source'
];
$save_data
[
'status'
]
=
$data
[
'status'
];
$save_data
[
'remark'
]
=
$data
[
'remark'
];
$save_data
[
'audit_level'
]
=
$data
[
'audit_level'
];
$save_data
[
'audit_id'
]
=
$data
[
'audit_id'
];
$save_data
[
'audit_name'
]
=
$data
[
'audit_name'
];
return
$this
->
save
(
$save_data
);
}
/**
* 获取最新审核
*
* @param $bargain_id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLastStep
(
$bargain_id
)
{
return
$this
->
field
(
'id,audit_level'
)
->
where
([
'bargain_id'
=>
$bargain_id
,
'status'
=>
1
])
->
order
(
'id desc'
)
->
find
();
}
}
\ No newline at end of file
application/route.php
View file @
06569a88
...
...
@@ -184,7 +184,10 @@ Route::group('index', [
'reportListUndone/:status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'status'
=>
21
]],
//财务 成交报告-已撤销
'refundList'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
]
],
//财务 退款
'accountList'
=>
[
'index/Finance/accountList'
,
[
'method'
=>
'get|post'
]
],
//财务 账户列表
'checkReport'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
]
],
//审核成交报告
'checkReportAttache/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
0
]],
//审核成交报告-专员审核
'checkReportManager/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
1
]],
//审核成交报告-经理审核
'checkReportMajordomo/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
2
]],
//审核成交报告-总监审核
'checkReportCashier/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
3
]],
//审核成交报告-出纳审核
'bargainInfo'
=>
[
'index/Finance/bargainInfo'
,
[
'method'
=>
'get'
]
],
//获取成交报告详情
'editBargainInfo'
=>
[
'index/Finance/editBargainInfo'
,
[
'method'
=>
'post'
]
],
//修改成交报告佣金
'addBargain'
=>
[
'index/Finance/addBargain'
,
[
'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