Commit 1986339e authored by 蔡闯's avatar 蔡闯

社区缴费列表修改

parent 378128ee
......@@ -101,18 +101,22 @@ class Payorder extends Base
$array_keys = array_keys($convertArr);
$unit = $this->myUnit;
foreach ($vacancys as $k =>$v) {
$where=[];
$where['vacancy_id'] = $v['vacancy_id'];
$where['is_pay'] = 1;
$res = Common::getVacancyAddress($v['vacancy_code'],$v['layout_id']);
$vacancys[$k]['vacancy_address'] = $res['vacancy_address'];
foreach ($convertArr as $key=>$value) {
$where['type'] = $key;
//总金额
$data= Db::name('cost')->where($where)->sum('pay_money');
//如果金额是0就跳过
if($data ==0) {
if($data == 0) {
continue;
}
// echo json_encode($where);
$rest['total_money'] = $data;
if($key == "property" || $key =="park"){
$count = Db::name('cost')->where($where)->count();
......@@ -126,12 +130,15 @@ class Payorder extends Base
$rest['name_zh'] = $value;
//获取最近的支付订单时间
$time = Db::name('cost')->where($where)->order('pay_time','desc')->value('pay_time');
$rest['pay_time'] = $time;
$all[] = $rest;
}
//获取自定义的
unset($where['type']);
$count = Db::name('cost')->where($where)->whereNotIn('type',$array_keys)->sum('pay_money');
//获取最近一次支付时间
$time = Db::name('cost')->where($where)->whereNotIn('type',['property','water','gas','electric','park'])->order('pay_time','desc')->value('pay_time');
$other['pay_time'] = $time;
......@@ -141,12 +148,15 @@ class Payorder extends Base
if($other['total_num'] !=0){
$all[] = $other;
}
$vacancys[$k]['pay_list'] = Common::changeField($all,'pay_time');
//如果当前房间没有已缴费记录,则去掉
if(empty($all)) {
unset($vacancys[$k]);
} else {
$vacancys[$k]['pay_list'] = Common::changeField($all,'pay_time');
//需要删除$all,数组,不然会影响下一次循环
unset($all);
}
}
} else {
$vacancys = [];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment