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
c84dc9ce
Commit
c84dc9ce
authored
Dec 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款列表
parent
2cf353a6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
380 additions
and
389 deletions
+380
-389
Collection.php
application/index/controller/Collection.php
+0
-384
Finance.php
application/index/controller/Finance.php
+375
-0
getCollection.html
application/index/view/finance/getCollection.html
+0
-0
route.php
application/route.php
+5
-5
No files found.
application/index/controller/Collection.php
deleted
100644 → 0
View file @
2cf353a6
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/4/16
* Time: 10:02
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\index\untils\ExportExcelUntil
;
use
app\model\OImg
;
use
app\model\OPayLogModel
;
class
Collection
extends
Basic
{
/**
* 收款记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCollection
()
{
if
(
$this
->
request
->
isAjax
()
||
$this
->
params
[
'excel'
]
==
1
)
{
$order
=
new
OPayLogModel
();
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$where
[
'a.is_del'
]
=
0
;
$is_show
=
0
;
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_start_time'
])
&&
empty
(
$this
->
params
[
'income_end_time'
]))
{
$where
[
'a.income_time'
]
=
[
'> time'
,
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
!
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'income_end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_title'
]))
{
$where
[
'd.internal_title'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_title'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'user_name'
]))
{
$where
[
'c.user_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'c.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'a.house_number'
]
=
$this
->
params
[
'id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'report_phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_phone'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'pay_type'
]))
{
$where
[
'a.pay_type'
]
=
$this
->
params
[
'pay_type'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'type'
]))
{
$where
[
'a.type'
]
=
$this
->
params
[
'type'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'report_name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'agent_name'
]))
{
$where
[
'a.agent_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'agent_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
empty
(
$this
->
params
[
'excel'
]))
{
$field
=
'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,
a.house_number,a.type,d.internal_title,d.internal_address,a.source,a.transaction_fee,c.report_agent_phone,
c.report_agent_name,f.store_name,g.district_name,a.income_time'
;
$data
[
'data'
][
'list'
]
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$order
->
getAddPayLogOrderListLmitTotal
(
$where
);
//加时间条件
if
(
$is_show
)
{
$data
[
'data'
][
'money_total'
]
=
$order
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
}
else
{
$data
[
'data'
][
'money_total'
]
=
''
;
}
foreach
(
$data
[
'data'
][
'list'
]
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'user_phone'
]))
{
$data
[
'data'
][
'list'
][
$k
][
'user_phone'
]
=
substr_replace
(
$v
[
'user_phone'
],
'****'
,
3
,
4
);
}
if
(
!
empty
(
$v
[
'income_time'
]))
{
$data
[
'data'
][
'list'
][
$k
][
'income_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
}
}
$data
[
'data'
][
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'data'
][
'list'
]);
return
$this
->
response
(
200
,
""
,
$data
[
'data'
]);
}
else
{
$pageNo
=
1
;
$pageSize
=
50000
;
//最多5万条数据
$field
=
'a.create_time,c.user_name,c.user_phone,c.report_agent_name,c.report_agent_phone,f.store_name,g.district_name,a.money,a.real_money,a.transaction_fee,a.type,a.pay_type,d.internal_address,a.house_number,a.source'
;
$data
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
foreach
(
$data
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'user_phone'
]))
{
$data
[
$k
][
'user_phone'
]
=
substr_replace
(
$v
[
'user_phone'
],
'****'
,
3
,
4
);
}
}
$data
=
$this
->
numberTransitionString
(
$data
);
$export
=
new
ExportExcelUntil
();
$title
=
[
'收款时间'
,
'客户姓名'
,
'客户手机号'
,
'约带看人姓名'
,
'约带看人手机号'
,
'约带看人所属门店'
,
'约带看人所属部门'
,
'收款金额(元)'
,
'实付金额(元)'
,
'手续费(元)'
,
'入账类型'
,
'入账方式'
,
'商铺地址'
,
'商铺号'
];
$export
->
exportTable
(
'收款记录'
,
$data
,
9
,
'收款记录'
,
$title
);
}
}
elseif
(
$this
->
request
->
isGet
())
{
return
view
(
'getCollection'
);
}
}
/**
* 收款记录-实付金额
*
* @return \think\Response
*/
public
function
addRealMoney
(){
$params
=
$this
->
params
;
/*$params = array(
"collection_id" => 1,
"real_money" => 77,
"transaction_fee" => 100,
);*/
if
(
!
isset
(
$params
[
"collection_id"
])
||
$params
[
"collection_id"
]
<=
0
){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
((
!
isset
(
$params
[
"real_money"
])
||
$params
[
"real_money"
]
<=
0
)
and
(
!
isset
(
$params
[
"transaction_fee"
])
||
$params
[
"transaction_fee"
]
<
0
)){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$where_
[
"id"
]
=
$params
[
"collection_id"
];
if
(
isset
(
$params
[
"real_money"
])){
$where_
[
"real_money"
]
=
$params
[
"real_money"
];
}
if
(
isset
(
$params
[
"transaction_fee"
])){
$where_
[
"transaction_fee"
]
=
$params
[
"transaction_fee"
];
}
if
(
isset
(
$params
[
"income_time"
])){
$where_
[
"income_time"
]
=
$params
[
"income_time"
];
}
$order
=
new
OPayLogModel
();
$id
=
$order
->
updatePayLog
(
$where_
);
if
(
$id
>
0
){
return
$this
->
response
(
"200"
,
"编辑成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"无记录修改或修改失败"
);
}
}
/**
* 收款列表-收款图片列表
* 朱伟 2018-07-04
*/
public
function
receiptImgList
(){
$params
=
$this
->
params
;
/*$params = array(
"id" => 6,
);*/
if
(
!
isset
(
$params
[
"id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$params
[
'id'
]
=
$params
[
"id"
];
$field
=
'id,father_id'
;
//先查询收款表
$order
=
new
OPayLogModel
();
$order_res
=
$order
->
selectReceiptImgList
(
$field
,
$params
);
//判断收款表数据father_id是否大于o,如果大于0图片需要按img_id=father_id查询
if
(
!
empty
(
$order_res
[
0
][
'father_id'
])
&&
(
$order_res
[
0
][
'father_id'
]
>
0
)){
$params_img
[
'img_id'
]
=
$order_res
[
0
][
'father_id'
];
}
else
{
$params_img
[
'img_id'
]
=
$params
[
'id'
];
}
$field
=
'id,img_name'
;
$order
=
new
OImg
();
$res
=
$order
->
getImgList
(
$params_img
,
$field
);
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
'img_name'
]
=
CHAT_IMG_URL
.
$v
[
'img_name'
];
}
if
(
$res
){
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
}
/**
* 收款列表记录上传图片
* 朱伟 2018-07-04
*/
public
function
addReceiptImg
(){
$params
=
$this
->
params
;
/*$params = array(
"img_id" => 1,
"img_name" => 123,
);*/
if
(
!
isset
(
$params
[
"img_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
(
!
isset
(
$params
[
"img_name"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$order
=
new
OImg
();
foreach
(
explode
(
','
,
$params
[
"img_name"
])
as
$k
=>
$v
){
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$save_data
[
"img_id"
]
=
$params
[
"img_id"
];
//id根据img_type区分是收款还是进场还是其他'
$save_data
[
"img_type"
]
=
2
;
//图片类型:1进场,2收款
$save_data
[
"img_name"
]
=
$v
;
//图片名称
$save_data
[
"img_status"
]
=
0
;
//删除状态 0正常 1删除
$save_data
[
"update_time"
]
=
$time
;
//更新时间
$save_data
[
"create_time"
]
=
$time
;
//创建时间
$res
=
$order
->
addImgOnce
(
$save_data
);
}
if
(
$res
){
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
/**
* 收款列表-删除上传图片
* 朱伟 2018-07-04
*/
public
function
deleteReceiptImg
(){
$params
=
$this
->
params
;
/*$params = array(
"id" => 3,
"img_name" => 123,
);*/
if
(
!
isset
(
$params
[
"id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$save_data
[
"id"
]
=
$params
[
"id"
];
//id根据img_type区分是收款还是进场还是其他'
$save_data
[
"img_status"
]
=
1
;
//删除状态 0正常 1删除
$save_data
[
"update_time"
]
=
$time
;
//更新时间
$order
=
new
OImg
();
$res
=
$order
->
updateImgStatus
(
$save_data
);
if
(
$res
){
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
/**
* @param $data
* @return mixed
*/
public
function
numberTransitionString
(
$data
)
{
//付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他 90佣金
//支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
foreach
(
$data
as
$k
=>
$v
)
{
switch
(
$v
[
'type'
])
{
case
10
:
$data
[
$k
][
'type'
]
=
'意向金'
;
break
;
case
20
:
$data
[
$k
][
'type'
]
=
'定金'
;
break
;
case
30
:
$data
[
$k
][
'type'
]
=
'保管金'
;
break
;
case
40
:
$data
[
$k
][
'type'
]
=
'押金'
;
break
;
case
50
:
$data
[
$k
][
'type'
]
=
'租金'
;
break
;
case
60
:
$data
[
$k
][
'type'
]
=
'进场费'
;
break
;
case
70
:
$data
[
$k
][
'type'
]
=
'转让费'
;
break
;
case
80
:
$data
[
$k
][
'type'
]
=
'其他'
;
break
;
case
90
:
$data
[
$k
][
'type'
]
=
'佣金'
;
break
;
}
switch
(
$v
[
'pay_type'
])
{
case
10
:
$data
[
$k
][
'pay_type'
]
=
'支付宝'
;
break
;
case
20
:
$data
[
$k
][
'pay_type'
]
=
'微信'
;
break
;
case
30
:
if
(
$v
[
'source'
]
==
0
)
{
$data
[
$k
][
'pay_type'
]
=
'POS机器'
;
}
elseif
(
$v
[
'source'
]
==
1
){
$data
[
$k
][
'pay_type'
]
=
'智能POS机器'
;
}
break
;
case
40
:
$data
[
$k
][
'pay_type'
]
=
'转账'
;
break
;
case
50
:
$data
[
$k
][
'pay_type'
]
=
'现金'
;
break
;
default
:
$data
[
$k
][
'pay_type'
]
=
'其他'
;
}
unset
(
$data
[
$k
][
'source'
]);
}
return
$data
;
}
}
\ No newline at end of file
application/index/controller/Finance.php
View file @
c84dc9ce
...
...
@@ -16,6 +16,7 @@ use app\index\untils\ExportExcelUntil;
use
app\model\AAgents
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainModel
;
use
app\model\OImg
;
use
app\model\OMarchInModel
;
use
app\model\ORealIncome
;
use
app\model\OTaxes
;
...
...
@@ -2232,6 +2233,380 @@ class Finance extends Basic
return
;
}
/**
* 收款记录
*
* @return \think\Response|\think\response\View|void
*/
public
function
getCollection
()
{
if
(
!
$this
->
request
->
isAjax
()
&&
$this
->
params
[
'excel'
]
!=
1
)
{
return
view
(
'getCollection'
);
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$data
[
'data'
]
=
[];
$where
[
'a.is_del'
]
=
0
;
$is_show
=
0
;
$msg
=
''
;
try
{
$order
=
new
OPayLogModel
();
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_start_time'
])
&&
empty
(
$this
->
params
[
'income_end_time'
]))
{
$where
[
'a.income_time'
]
=
[
'> time'
,
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
!
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'income_end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_title'
]))
{
$where
[
'd.internal_title'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_title'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'user_name'
]))
{
$where
[
'c.user_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'c.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'a.house_number'
]
=
$this
->
params
[
'id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'report_phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_phone'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'pay_type'
]))
{
$where
[
'a.pay_type'
]
=
$this
->
params
[
'pay_type'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'type'
]))
{
$where
[
'a.type'
]
=
$this
->
params
[
'type'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'report_name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'agent_name'
]))
{
$where
[
'a.agent_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'agent_name'
]
.
'%'
];
$is_show
=
1
;
}
if
(
empty
(
$this
->
params
[
'excel'
]))
{
$field
=
'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,
a.house_number,a.type,d.internal_title,d.internal_address,a.source,a.transaction_fee,c.report_agent_phone,
c.report_agent_name,f.store_name,g.district_name,a.income_time'
;
$data
[
'list'
]
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$order
->
getAddPayLogOrderListLmitTotal
(
$where
);
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$order
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
}
else
{
$data
[
'money_total'
]
=
''
;
}
foreach
(
$data
[
'list'
]
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'user_phone'
]))
{
$data
[
'list'
][
$k
][
'user_phone'
]
=
substr_replace
(
$v
[
'user_phone'
],
'****'
,
3
,
4
);
}
if
(
!
empty
(
$v
[
'income_time'
]))
{
$data
[
'list'
][
$k
][
'income_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
}
}
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
}
else
{
$pageNo
=
1
;
$pageSize
=
50000
;
//最多5万条数据
$field
=
'a.create_time,c.user_name,c.user_phone,c.report_agent_name,c.report_agent_phone,f.store_name,g.district_name,a.money,a.real_money,a.transaction_fee,a.type,a.pay_type,d.internal_address,a.house_number,a.source'
;
$data
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
foreach
(
$data
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'user_phone'
]))
{
$data
[
$k
][
'user_phone'
]
=
substr_replace
(
$v
[
'user_phone'
],
'****'
,
3
,
4
);
}
}
$data
=
$this
->
numberTransitionString
(
$data
);
$export
=
new
ExportExcelUntil
();
$title
=
[
'收款时间'
,
'客户姓名'
,
'客户手机号'
,
'约带看人姓名'
,
'约带看人手机号'
,
'约带看人所属门店'
,
'约带看人所属部门'
,
'收款金额(元)'
,
'实付金额(元)'
,
'手续费(元)'
,
'入账类型'
,
'入账方式'
,
'商铺地址'
,
'商铺号'
];
$export
->
exportTable
(
'收款记录'
,
$data
,
9
,
'收款记录'
,
$title
);
}
}
catch
(
\Exception
$e
)
{
$msg
=
'内部错误:'
.
$e
->
getMessage
();
if
(
$this
->
params
[
'excel'
]
==
1
)
{
return
$this
->
error
(
$msg
);
}
}
return
$this
->
response
(
200
,
$msg
,
$data
);
}
/**
* 返回对应类型
*
* @param $data
* @return mixed
*/
public
function
numberTransitionString
(
$data
)
{
//付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他 90佣金
//支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
foreach
(
$data
as
$k
=>
$v
)
{
switch
(
$v
[
'type'
])
{
case
10
:
$data
[
$k
][
'type'
]
=
'意向金'
;
break
;
case
20
:
$data
[
$k
][
'type'
]
=
'定金'
;
break
;
case
30
:
$data
[
$k
][
'type'
]
=
'保管金'
;
break
;
case
40
:
$data
[
$k
][
'type'
]
=
'押金'
;
break
;
case
50
:
$data
[
$k
][
'type'
]
=
'租金'
;
break
;
case
60
:
$data
[
$k
][
'type'
]
=
'进场费'
;
break
;
case
70
:
$data
[
$k
][
'type'
]
=
'转让费'
;
break
;
case
80
:
$data
[
$k
][
'type'
]
=
'其他'
;
break
;
case
90
:
$data
[
$k
][
'type'
]
=
'佣金'
;
break
;
}
switch
(
$v
[
'pay_type'
])
{
case
10
:
$data
[
$k
][
'pay_type'
]
=
'支付宝'
;
break
;
case
20
:
$data
[
$k
][
'pay_type'
]
=
'微信'
;
break
;
case
30
:
if
(
$v
[
'source'
]
==
0
)
{
$data
[
$k
][
'pay_type'
]
=
'POS机器'
;
}
elseif
(
$v
[
'source'
]
==
1
){
$data
[
$k
][
'pay_type'
]
=
'智能POS机器'
;
}
break
;
case
40
:
$data
[
$k
][
'pay_type'
]
=
'转账'
;
break
;
case
50
:
$data
[
$k
][
'pay_type'
]
=
'现金'
;
break
;
default
:
$data
[
$k
][
'pay_type'
]
=
'其他'
;
}
unset
(
$data
[
$k
][
'source'
]);
}
return
$data
;
}
/**
* 收款记录-实付金额
*
* @return \think\Response
*/
public
function
addRealMoney
(){
$params
=
$this
->
params
;
/*$params = array(
"collection_id" => 1,
"real_money" => 77,
"transaction_fee" => 100,
);*/
if
(
!
isset
(
$params
[
"collection_id"
])
||
$params
[
"collection_id"
]
<=
0
){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
((
!
isset
(
$params
[
"real_money"
])
||
$params
[
"real_money"
]
<=
0
)
and
(
!
isset
(
$params
[
"transaction_fee"
])
||
$params
[
"transaction_fee"
]
<
0
)){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$where_
[
"id"
]
=
$params
[
"collection_id"
];
if
(
isset
(
$params
[
"real_money"
])){
$where_
[
"real_money"
]
=
$params
[
"real_money"
];
}
if
(
isset
(
$params
[
"transaction_fee"
])){
$where_
[
"transaction_fee"
]
=
$params
[
"transaction_fee"
];
}
if
(
isset
(
$params
[
"income_time"
])){
$where_
[
"income_time"
]
=
$params
[
"income_time"
];
}
$order
=
new
OPayLogModel
();
$id
=
$order
->
updatePayLog
(
$where_
);
if
(
$id
>
0
){
return
$this
->
response
(
"200"
,
"编辑成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"无记录修改或修改失败"
);
}
}
/**
* 收款列表-收款图片列表
* 朱伟 2018-07-04
*/
public
function
receiptImgList
(){
$params
=
$this
->
params
;
/*$params = array(
"id" => 6,
);*/
if
(
!
isset
(
$params
[
"id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$params
[
'id'
]
=
$params
[
"id"
];
$field
=
'id,father_id'
;
//先查询收款表
$order
=
new
OPayLogModel
();
$order_res
=
$order
->
selectReceiptImgList
(
$field
,
$params
);
//判断收款表数据father_id是否大于o,如果大于0图片需要按img_id=father_id查询
if
(
!
empty
(
$order_res
[
0
][
'father_id'
])
&&
(
$order_res
[
0
][
'father_id'
]
>
0
)){
$params_img
[
'img_id'
]
=
$order_res
[
0
][
'father_id'
];
}
else
{
$params_img
[
'img_id'
]
=
$params
[
'id'
];
}
$field
=
'id,img_name'
;
$order
=
new
OImg
();
$res
=
$order
->
getImgList
(
$params_img
,
$field
);
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
'img_name'
]
=
CHAT_IMG_URL
.
$v
[
'img_name'
];
}
if
(
$res
){
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
}
/**
* 收款列表记录上传图片
* 朱伟 2018-07-04
*/
public
function
addReceiptImg
(){
$params
=
$this
->
params
;
$result
=
0
;
/*$params = array(
"img_id" => 1,
"img_name" => 123,
);*/
if
(
!
isset
(
$params
[
"img_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
if
(
!
isset
(
$params
[
"img_name"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$order
=
new
OImg
();
foreach
(
explode
(
','
,
$params
[
"img_name"
])
as
$k
=>
$v
){
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$save_data
[
"img_id"
]
=
$params
[
"img_id"
];
//id根据img_type区分是收款还是进场还是其他'
$save_data
[
"img_type"
]
=
2
;
//图片类型:1进场,2收款
$save_data
[
"img_name"
]
=
$v
;
//图片名称
$save_data
[
"img_status"
]
=
0
;
//删除状态 0正常 1删除
$save_data
[
"update_time"
]
=
$time
;
//更新时间
$save_data
[
"create_time"
]
=
$time
;
//创建时间
$result
=
$order
->
addImgOnce
(
$save_data
);
}
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
/**
* 收款列表-删除上传图片
* 朱伟 2018-07-04
*/
public
function
deleteReceiptImg
(){
$params
=
$this
->
params
;
/*$params = array(
"id" => 3,
"img_name" => 123,
);*/
if
(
!
isset
(
$params
[
"id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$save_data
[
"id"
]
=
$params
[
"id"
];
//id根据img_type区分是收款还是进场还是其他'
$save_data
[
"img_status"
]
=
1
;
//删除状态 0正常 1删除
$save_data
[
"update_time"
]
=
$time
;
//更新时间
$order
=
new
OImg
();
$res
=
$order
->
updateImgStatus
(
$save_data
);
if
(
$res
){
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
/**
* 获取收款入账
*
...
...
application/index/view/
collection
/getCollection.html
→
application/index/view/
finance
/getCollection.html
View file @
c84dc9ce
File moved
application/route.php
View file @
c84dc9ce
...
...
@@ -257,8 +257,8 @@ Route::group('index', [
'searchOrderAgents'
=>
[
'index/Finance/searchOrderAgents'
,
[
'method'
=>
'GET'
]],
//order_id获取盘方,客方,反签,独家,合作方
'getTallAgeList'
=>
[
'index/Finance/getTallAgeList'
,
[
'method'
=>
'GET'
]],
//税费承担明细表
'getCommissionTotalList'
=>
[
'index/Finance/getCommissionTotalListV2'
,
[
'method'
=>
'GET'
]],
//分佣提成汇总表
'getCollection'
=>
[
'index/
Collection
/getCollection'
,
[
'method'
=>
'post|get'
]],
//收款记录
'addRealMoney'
=>
[
'index/
Collection
/addRealMoney'
,
[
'method'
=>
'post|get'
]],
//新增实收
'getCollection'
=>
[
'index/
Finance
/getCollection'
,
[
'method'
=>
'post|get'
]],
//收款记录
'addRealMoney'
=>
[
'index/
Finance
/addRealMoney'
,
[
'method'
=>
'post|get'
]],
//新增实收
'visitShop'
=>
[
'index/Supervise/visitShop'
,
[
'method'
=>
'get'
]],
//门店拜访
'carryOut'
=>
[
'index/Supervise/carryOut'
,
[
'method'
=>
'get'
]],
//监督执行
'toReportListOne'
=>
[
'index/Finance/toReportListOne'
,
[
'method'
=>
'POST'
]],
//回到一级审核
...
...
@@ -268,9 +268,9 @@ Route::group('index', [
'getBargainCommission'
=>
[
'index/Finance/getBargainCommission'
,
[
'method'
=>
'GET|POST'
]],
//获取成交报告分佣方佣金和修改
'dailyList'
=>
[
'index/Finance/dailyList'
,
[
'method'
=>
'GET'
]],
//财务日报列表
'dailyDetails'
=>
[
'index/Finance/dailyDetails'
,
[
'method'
=>
'GET|POST'
]],
//财务日报详情
'addReceiptImg'
=>
[
'index/
Collection
/addReceiptImg'
,
[
'method'
=>
'post|get'
]],
//收款图片信息保存
'deleteReceiptImg'
=>
[
'index/
Collection
/deleteReceiptImg'
,
[
'method'
=>
'post|get'
]],
//删除收款图片
'receiptImgList'
=>
[
'index/
Collection
/receiptImgList'
,
[
'method'
=>
'post|get'
]],
//收款列表-收款图片列表
'addReceiptImg'
=>
[
'index/
Finance
/addReceiptImg'
,
[
'method'
=>
'post|get'
]],
//收款图片信息保存
'deleteReceiptImg'
=>
[
'index/
Finance
/deleteReceiptImg'
,
[
'method'
=>
'post|get'
]],
//删除收款图片
'receiptImgList'
=>
[
'index/
Finance
/receiptImgList'
,
[
'method'
=>
'post|get'
]],
//收款列表-收款图片列表
'performanceInfo'
=>
[
'index/PerformanceInfo/performanceInfo'
,
[
'method'
=>
'post|get'
]],
//业绩明细
'getPerformanceInfoExcel'
=>
[
'index/PerformanceInfo/getPerformanceInfoExcel'
,
[
'method'
=>
'post|get'
]],
//业绩明细
...
...
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