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
231b31b8
Commit
231b31b8
authored
May 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
退款列表
parent
78b18c21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
14 deletions
+90
-14
Finance.php
application/index/controller/Finance.php
+38
-10
ORefundModel.php
application/model/ORefundModel.php
+48
-0
route.php
application/route.php
+4
-4
No files found.
application/index/controller/Finance.php
View file @
231b31b8
...
...
@@ -422,21 +422,50 @@ class Finance extends Basic
*/
public
function
refundList
()
{
//显示视图
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'refundList'
);
}
$data
[
'code'
]
=
200
;
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$check_status
=
[
0
,
1
,
2
,
3
];
if
(
in_array
(
$this
->
params
[
'check_status'
],
$check_status
))
{
switch
(
$this
->
params
[
'check_status'
])
{
case
1
:
//退款列表-经理审核
$where
[
'e.audit_level'
]
=
0
;
break
;
case
2
:
//退款列表-总监审核
$where
[
'e.audit_level'
]
=
1
;
break
;
case
3
:
//退款列表-出纳审核
$where
[
'e.audit_level'
]
=
2
;
break
;
default
:
//退款列表-专员审核
$where
[
'e.audit_level'
]
=
[
'NULL'
];
}
}
else
{
$where
[
'e.audit_level'
]
=
[
'NULL'
];
}
$where
[
'a.status'
]
=
1
;
$refund
=
new
ORefundModel
();
$field
=
''
;
$where
=
[];
$fields
=
'a.id,a.agent_name,a.name,a.bank,a.card_no,a.create_time,a.refund_money,b.report_agent_name,b.user_name'
;
$data
[
'data'
][
'list'
]
=
$refund
->
getCheckRefundList
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$refund
->
getCheckRefundListTotal
(
$where
);
$data
[
'data'
][
'list'
]
=
$refund
->
selectRefundByOrderNoPage
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$refund
->
selectRefundByOrderNoPageTotal
(
$where
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
$data
[
'code'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
/**
...
...
@@ -454,13 +483,13 @@ class Finance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$refund
=
new
ORefundModel
();
$field
=
'a.id,a.agent_name,a.name,a.bank,a.card_no,a.create_time,a.refund_money,b.report_agent_name'
;
$where
=
[];
$refund
=
new
ORefundModel
();
$field
=
'a.id,a.agent_name,a.name,a.bank,a.card_no,a.create_time,a.refund_money,b.report_agent_name,b.user_name'
;
// $where['status'] = 2; //退款成功
$data
[
'data'
][
'list'
]
=
$refund
->
selectRefundByOrderNoPage
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$refund
->
selectRefundByOrderNoPageTotal
(
$where
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
\ No newline at end of file
}
application/model/ORefundModel.php
View file @
231b31b8
...
...
@@ -163,6 +163,14 @@ class ORefundModel extends Model{
->
count
();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRefundByOrderId
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"order_id"
])){
...
...
@@ -180,4 +188,43 @@ class ORefundModel extends Model{
->
where
(
$where_
)
->
select
();
}
/**
* 退款列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCheckRefundList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
Db
::
table
(
$this
->
table
)
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_financial_audit c'
,
'a.order_id=c.order_id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
select
();
}
/**
* 退款列表
*
* @param $params
* @return int|string
*/
public
function
getCheckRefundListTotal
(
$params
)
{
return
Db
::
table
(
$this
->
table
)
->
alias
(
'a'
)
->
join
(
'o_report b'
,
'a.report_id = b.id'
,
'left'
)
->
join
(
'o_financial_audit c'
,
'a.order_id=c.order_id'
,
'left'
)
->
count
();
}
}
\ No newline at end of file
application/route.php
View file @
231b31b8
...
...
@@ -191,10 +191,10 @@ Route::group('index', [
'reportListStatement/:check_status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'check_status'
=>
4
]],
//财务 成交报告-已结单
'reportListBackout/:check_status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'check_status'
=>
5
]],
//财务 成交报告-待撤销
'reportListUndone/:check_status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
]
,[
'check_status'
=>
6
]],
//财务 成交报告-已撤销
'refundListAttache/:
status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'
status'
=>
0
]
],
//退款列表-专员审核
'refundListManager/:
status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'
status'
=>
1
]
],
//退款列表-财务经理
'refundListMajordomo/:
status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'status'
=>
2
]
],
//财务 退款
'refundListCashier/:
status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'status'
=>
3
]
],
//财务 退款
'refundListAttache/:
check_status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'check_
status'
=>
0
]
],
//退款列表-专员审核
'refundListManager/:
check_status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'check_
status'
=>
1
]
],
//退款列表-财务经理
'refundListMajordomo/:
check_status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'check_status'
=>
2
]
],
//退款列表-总监审核
'refundListCashier/:
check_status'
=>
[
'index/Finance/refundList'
,
[
'method'
=>
'get|post'
],
[
'check_status'
=>
3
]
],
//退款列表-出纳审核
'refundOrderList'
=>
[
'index/Finance/refundOrderList'
,
[
'method'
=>
'get'
]],
//财务 已退款
'checkReportAttache/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
0
]],
//审核成交报告-专员审核
'checkReportManager/:check_status'
=>
[
'index/Finance/checkReport'
,
[
'method'
=>
'post'
],
[
'check_status'
=>
1
]],
//审核成交报告-经理审核
...
...
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