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
25858c13
Commit
25858c13
authored
Sep 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款删除
parent
ae991583
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
156 additions
and
89 deletions
+156
-89
OfficePayLog.php
application/index/controller/OfficePayLog.php
+150
-88
PayLog.php
application/index/controller/PayLog.php
+5
-0
route.php
application/route.php
+1
-1
No files found.
application/index/controller/OfficePayLog.php
View file @
25858c13
...
...
@@ -12,7 +12,6 @@ use app\index\extend\Basic;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGRoom
;
use
app\model\OfficeGRoomToAgent
;
use
app\model\OfficeOBargainModel
;
...
...
@@ -38,160 +37,136 @@ class OfficePayLog extends Basic
}
/**
*
收款记录
*
构造条件
*
* @return \think\Response|\think\response\View|void
* @param $params
* @return array
*/
p
ublic
function
getCollection
(
)
p
rivate
function
buildWhere
(
$params
)
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$data
=
[];
$where
[
'a.is_del'
]
=
0
;
$is_show
=
0
;
$msg
=
''
;
$where
=
[];
/*提交时间 start*/
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
(
$params
[
'start_time'
])
&&
empty
(
$params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$params
[
'start_time'
]
.
' 00:00:00'
];
}
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
(
$params
[
'end_time'
])
&&
empty
(
$params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$params
[
'end_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$
this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
if
(
!
empty
(
$
params
[
'end_time'
])
&&
!
empty
(
$
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$
this
->
params
[
'start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
$
params
[
'start_time'
]
.
' 00:00:00'
,
$
params
[
'end_time'
]
.
' 23:59:59'
]
];
$is_show
=
1
;
}
/*提交时间 end*/
/*入账日期 start*/
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
(
$params
[
'income_start_time'
])
&&
empty
(
$params
[
'income_end_time'
]))
{
$where
[
'a.income_time'
]
=
[
'> time'
,
$params
[
'income_start_time'
]
.
' 00:00:00'
];
}
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
(
$params
[
'income_end_time'
])
&&
empty
(
$params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'< time'
,
$params
[
'end_time'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$
this
->
params
[
'income_end_time'
])
&&
!
empty
(
$this
->
params
[
'income_start_time'
]))
{
if
(
!
empty
(
$
params
[
'income_end_time'
])
&&
!
empty
(
$
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'
$
params
[
'income_start_time'
]
.
' 00:00:00'
,
$
params
[
'income_end_time'
]
.
' 23:59:59'
]
];
$is_show
=
1
;
}
/*入账日期 end*/
/*收款确认日期 start*/
if
(
!
empty
(
$this
->
params
[
'open_time_start'
])
&&
empty
(
$this
->
params
[
'open_end_time'
]))
{
$where
[
'a.open_time'
]
=
[
'> time'
,
$this
->
params
[
'open_time_start'
]
.
' 00:00:00'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'open_time_start'
])
&&
empty
(
$params
[
'open_end_time'
]))
{
$where
[
'a.open_time'
]
=
[
'> time'
,
$params
[
'open_time_start'
]
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'open_time_end'
])
&&
empty
(
$this
->
params
[
'open_time_start'
]))
{
$where
[
'a.open_time'
]
=
[
'< time'
,
$this
->
params
[
'open_time_end'
]
.
' 23:59:59'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'open_time_end'
])
&&
empty
(
$params
[
'open_time_start'
]))
{
$where
[
'a.open_time'
]
=
[
'< time'
,
$params
[
'open_time_end'
]
.
' 23:59:59'
];
}
if
(
!
empty
(
$
this
->
params
[
'open_time_end'
])
&&
!
empty
(
$this
->
params
[
'open_time_start'
]))
{
if
(
!
empty
(
$
params
[
'open_time_end'
])
&&
!
empty
(
$
params
[
'open_time_start'
]))
{
$where
[
'a.open_time'
]
=
[
'between time'
,
[
$
this
->
params
[
'open_time_start'
]
.
' 00:00:00'
,
$this
->
params
[
'open_time_end'
]
.
' 23:59:59'
$
params
[
'open_time_start'
]
.
' 00:00:00'
,
$
params
[
'open_time_end'
]
.
' 23:59:59'
]
];
$is_show
=
1
;
}
/*入账日期 end*/
//商铺地址
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'g.address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'internal_address'
]))
{
$where
[
'g.address'
]
=
[
'like'
,
'%'
.
$params
[
'internal_address'
]
.
'%'
];
}
//商铺ID
if
(
!
empty
(
$this
->
params
[
'house_id'
]))
{
$where
[
'b.house_id'
]
=
$this
->
params
[
'house_id'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'house_id'
]))
{
$where
[
'b.house_id'
]
=
$params
[
'house_id'
];
}
//提交人所在门店
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$params
[
'store_id'
];
}
//提交人所在部门
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$params
[
'district_id'
];
}
//提交人姓名
if
(
!
empty
(
$this
->
params
[
'agent_id'
]))
{
$where
[
'a.agent_id'
]
=
$this
->
params
[
'agent_id'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'agent_id'
]))
{
$where
[
'a.agent_id'
]
=
$params
[
'agent_id'
];
}
//入账方式
if
(
!
empty
(
$this
->
params
[
'pay_type'
]))
{
$where
[
'a.pay_type'
]
=
$this
->
params
[
'pay_type'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'pay_type'
]))
{
$where
[
'a.pay_type'
]
=
$params
[
'pay_type'
];
}
//入账类型
if
(
!
empty
(
$this
->
params
[
'type'
]))
{
$where
[
'a.type'
]
=
$this
->
params
[
'type'
];
$is_show
=
1
;
if
(
!
empty
(
$params
[
'type'
]))
{
$where
[
'a.type'
]
=
$params
[
'type'
];
}
//来源
if
(
$
this
->
params
[
'source'
]
>
-
1
)
{
if
(
$
this
->
params
[
'source'
]
==
1
)
{
if
(
$params
[
'source'
]
>
-
1
)
{
if
(
$params
[
'source'
]
==
1
)
{
$where
[
'a.source'
]
=
[
'in'
,
'0,1'
];
}
else
{
$where
[
'a.source'
]
=
$
this
->
params
[
'source'
];
$where
[
'a.source'
]
=
$params
[
'source'
];
}
$is_show
=
1
;
}
if
(
!
empty
(
$
this
->
params
[
'bargain_id'
]))
{
// $order_id = $this->m_bargain->getFieldValue('order_id', ['id'=>$
this->
params['bargain_id'],'father_id'=>0]);
if
(
!
empty
(
$params
[
'bargain_id'
]))
{
// $order_id = $this->m_bargain->getFieldValue('order_id', ['id'=>$params['bargain_id'],'father_id'=>0]);
// if (!empty($order_id)) {
// $where[] = ['EXP', 'a.order_id='.$order_id];
// }
$where
[
'a.bargain_id'
]
=
$this
->
params
[
'bargain_id'
];
$is_show
=
1
;
$where
[
'a.bargain_id'
]
=
$params
[
'bargain_id'
];
}
if
(
!
empty
(
$
this
->
params
[
'pay_id'
]))
{
$where
[
'a.id'
]
=
$
this
->
params
[
'pay_id'
];
if
(
!
empty
(
$params
[
'pay_id'
]))
{
$where
[
'a.id'
]
=
$params
[
'pay_id'
];
}
if
(
!
empty
(
$
this
->
params
[
'order_id'
]))
{
$where
[
'a.order_id'
]
=
$
this
->
params
[
'order_id'
];
if
(
!
empty
(
$params
[
'order_id'
]))
{
$where
[
'a.order_id'
]
=
$params
[
'order_id'
];
}
if
(
!
empty
(
$
this
->
params
[
'bargain_id'
]))
{
$where
[
'a.bargain_id'
]
=
$
this
->
params
[
'bargain_id'
];
if
(
!
empty
(
$params
[
'bargain_id'
]))
{
$where
[
'a.bargain_id'
]
=
$params
[
'bargain_id'
];
}
if
(
!
empty
(
$
this
->
params
[
'source_type'
]))
{
$where
[
'a.bargain_id'
]
=
$
this
->
params
[
'bargain_id'
];
if
(
!
empty
(
$params
[
'source_type'
]))
{
$where
[
'a.bargain_id'
]
=
$params
[
'bargain_id'
];
}
if
(
is_numeric
(
$
this
->
params
[
'source_type'
]))
{
if
(
$
this
->
params
[
'source_type'
]
==
1
)
{
if
(
is_numeric
(
$params
[
'source_type'
]))
{
if
(
$params
[
'source_type'
]
==
1
)
{
$where
[
'a.source'
]
=
array
(
'neq'
,
2
);
}
else
{
$where
[
'a.source'
]
=
2
;
...
...
@@ -199,8 +174,8 @@ class OfficePayLog extends Basic
}
//案场费和中介费是否开业
if
(
isset
(
$
this
->
params
[
'is_open'
]))
{
if
(
$
this
->
params
[
'is_open'
]
==
1
)
{
if
(
isset
(
$params
[
'is_open'
]))
{
if
(
$params
[
'is_open'
]
==
1
)
{
$where
[
'a.is_open'
]
=
1
;
}
else
{
$where
[
'a.is_open'
]
=
0
;
...
...
@@ -209,14 +184,35 @@ class OfficePayLog extends Basic
if
(
!
isset
(
$where
[
'a.type'
]))
{
$where
[
'a.type'
]
=
[
'in'
,
'91,92'
];
}
$is_show
=
1
;
}
if
(
isset
(
$
this
->
params
[
'is_normality'
])
&&
$this
->
params
[
'is_normality'
]
==
1
)
{
if
(
isset
(
$
params
[
'is_normality'
])
&&
$
params
[
'is_normality'
]
==
1
)
{
$where
[]
=
[
'EXP'
,
'(select id from o_refund where pay_log_id=a.id and is_del = 0 group by pay_log_id) is null'
];
$where
[]
=
[
'EXP'
,
'(select id from o_paylog_adjustment where paylog_id=a.id and is_del = 0 group by paylog_id) is null '
];
}
return
$where
;
}
/**
* 收款记录
*
* @return \think\Response|\think\response\View|void
*/
public
function
getCollection
()
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$data
=
[];
$where
=
$this
->
buildWhere
(
$this
->
params
);
if
(
empty
(
$where
))
{
$is_show
=
0
;
}
else
{
$is_show
=
1
;
}
$where
[
'a.is_del'
]
=
0
;
$msg
=
''
;
try
{
$order
=
new
OfficeOPayLogModel
();
...
...
@@ -295,6 +291,76 @@ class OfficePayLog extends Basic
return
$this
->
response
(
200
,
$msg
,
$data
);
}
/**
* 收款记录
*
* @return \think\Response|\think\response\View|void
*/
public
function
getCollectionDel
()
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$data
=
[];
$where
=
$this
->
buildWhere
(
$this
->
params
);
$where
[
'a.is_del'
]
=
0
;
$msg
=
''
;
try
{
$order
=
new
OfficeOPayLogModel
();
$field
=
'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,b.f_id,a.transfer_name,a.receipt_number,a.bargain_id,'
;
$field
.=
'e.name,a.income_time,e.store_id,b.house_id,b.order_no,a.report_id,a.house_number,a.is_dividend,a.last_transfer_time,a.industry_type,a.agent_id,e.name as agent_name,g.address'
;
$list
=
$order
->
getAddPayLogOrderListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$order
->
getAddPayLogOrderListLimitTotal
(
$where
);
$m_pay_adjustment
=
new
OfficeOPayLogAdjustment
();
$m_refund
=
new
OfficeORefundModel
();
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'source_id'
]
=
$list
[
$k
][
'is_adjustment'
]
=
''
;
if
(
$v
[
'source'
]
==
2
)
{
$source_id
=
$m_pay_adjustment
->
getFieldColumn
(
'id'
,
[
'new_paylog_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
$list
[
$k
][
'source_id'
]
=
empty
(
$source_id
)
?
0
:
implode
(
','
,
$source_id
);
$adjustment_id
=
$m_pay_adjustment
->
getFieldColumn
(
'id'
,
[
'paylog_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
$list
[
$k
][
'is_adjustment'
]
=
$adjustment_id
?
1
:
0
;
}
else
{
$source_id
=
$m_pay_adjustment
->
getFieldColumn
(
'id'
,
[
'paylog_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
$list
[
$k
][
'source_id'
]
=
empty
(
$source_id
)
?
0
:
implode
(
','
,
$source_id
);
$list
[
$k
][
'is_adjustment'
]
=
$source_id
?
1
:
0
;
}
$num
=
$m_refund
->
getFind
(
'id'
,
[
'pay_log_id'
=>
$v
[
'id'
],
'is_del'
=>
0
]);
if
(
$num
[
'id'
]
>
0
)
{
$list
[
$k
][
'is_refund'
]
=
1
;
}
else
{
$list
[
$k
][
'is_refund'
]
=
0
;
}
if
(
$v
[
'type'
]
!=
10
&&
$v
[
'type'
]
!=
30
)
{
$list
[
$k
][
'bargain_id'
]
=
empty
(
$v
[
'bargain_id'
])
?
''
:
$v
[
'bargain_id'
];
}
else
{
$list
[
$k
][
'bargain_id'
]
=
''
;
}
if
(
!
empty
(
$v
[
'income_time'
]))
{
$income_time
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$v
[
'income_time'
]));
if
(
$income_time
==
$v
[
'income_time'
])
{
$list
[
$k
][
'income_time'
]
=
$income_time
;
}
else
{
$list
[
$k
][
'income_time'
]
=
''
;
}
}
$list
[
$k
][
'pay_type_num'
]
=
$v
[
'pay_type'
];
$list
[
$k
][
'type_num'
]
=
$v
[
'type'
];
}
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$list
);
}
catch
(
\Exception
$e
)
{
$msg
=
'内部错误:'
.
$e
->
getMessage
();
if
(
$this
->
params
[
'excel'
]
==
1
)
{
return
$this
->
error
(
$msg
);
}
}
return
$this
->
response
(
200
,
$msg
,
$data
);
}
/**
* 收款记录 Excel
*/
...
...
@@ -306,9 +372,6 @@ class OfficePayLog extends Basic
$data
=
[];
$where
[
'a.is_del'
]
=
0
;
$is_show
=
0
;
$msg
=
''
;
/*提交时间 start*/
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]
.
' 00:00:00'
];
...
...
@@ -333,7 +396,6 @@ class OfficePayLog extends Basic
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'
]))
{
...
...
@@ -825,7 +887,7 @@ class OfficePayLog extends Basic
$data
[
'total'
]
=
$m_paylog
->
getAdjustmentListTotal
(
$where
);
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
);
//总额
}
else
{
$data
[
'money_total'
]
=
''
;
}
...
...
@@ -1785,7 +1847,7 @@ class OfficePayLog extends Basic
$data
[
'total'
]
=
$m_paylog
->
getAdjustmentListTotal
(
$where
);
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
);
//总额
}
else
{
$data
[
'money_total'
]
=
''
;
}
...
...
application/index/controller/PayLog.php
View file @
25858c13
...
...
@@ -477,6 +477,11 @@ class PayLog extends Basic
return
$data
;
}
/**
* 收款-删除
*
* @return \think\Response|\think\response\View|void
*/
public
function
getCollectionDel
()
{
if
(
!
$this
->
request
->
isAjax
())
{
...
...
application/route.php
View file @
25858c13
...
...
@@ -1184,7 +1184,7 @@ Route::group('office_index', [
'getRecords'
=>
[
'index/OfficeRoom/getRecords'
,
[
'method'
=>
'GET'
]],
//盘方操作记录
'batchChangDish'
=>
[
'index/OfficeRoom/batchChangDish'
,
[
'method'
=>
'post'
]],
//批量修改盘方
'getCollection'
=>
[
'index/OfficePayLog/getCollection'
,
[
'method'
=>
'GET'
]],
//收款记录
'getCollectionDel'
=>
[
'index/OfficePayLog/getCollection
'
,
[
'method'
=>
'GET'
]],
//收款记录
'getCollectionDel'
=>
[
'index/OfficePayLog/getCollection
Del'
,
[
'method'
=>
'GET'
]],
//收款记录-删除
'getCollectionExcel'
=>
[
'index/OfficePayLog/getCollectionExcel'
,
[
'method'
=>
'get'
]],
//导出收款记录
'adjustment'
=>
[
'index/OfficePayLog/adjustment'
,
[
'method'
=>
'get'
]],
//导出收款记录
'getCollectionDetail'
=>
[
'index/OfficePayLog/getCollectionDetail'
,
[
'method'
=>
'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