|
@@ -104,6 +104,7 @@ class CostAdd extends Backend
|
|
|
}else{
|
|
|
$get_hu_list=VillageHu::where('village_id',$params['village_id'])->where(['dong_id'=>['in',explode(',',$get_item['dong_id'])]])->field('id,big_area,village_id,dong_id,danyuan_id')->select();
|
|
|
}
|
|
|
+
|
|
|
if ($get_item['item']=='1' || $get_item['item']=='2' || $get_item['item']=='3'){//如果是物业和垃圾处理费
|
|
|
// <option value="1">元/每平方/月</option>
|
|
|
// <option value="2">元/每户/年</option>
|
|
@@ -136,7 +137,7 @@ class CostAdd extends Backend
|
|
|
// }
|
|
|
}elseif($get_item['method']=='2'){//按照户收费
|
|
|
|
|
|
- // if ($get_item['danwei']=='1'){//按照月收费
|
|
|
+ if ($get_item['danwei']=='3'){//按照月收费
|
|
|
|
|
|
foreach ($get_hu_list as $k=>$v){
|
|
|
$insert=[];
|
|
@@ -156,7 +157,29 @@ class CostAdd extends Backend
|
|
|
CostBill::insert($insert);
|
|
|
}
|
|
|
}
|
|
|
- // }
|
|
|
+ }elseif($get_item['danwei']=='2'){
|
|
|
+
|
|
|
+ foreach ($get_hu_list as $k=>$v){
|
|
|
+
|
|
|
+ $insert=[];
|
|
|
+ $insert['order_number']=time().rand('1000','9999');
|
|
|
+ $price=$get_item['price']*$get_item['month']/12;//价格*平方*周期
|
|
|
+ $insert['item_id']=$params['item_id'];
|
|
|
+ $insert['village_id']=$v['village_id'];
|
|
|
+ $insert['dong_id']=$v['dong_id'];
|
|
|
+ $insert['danyuan_id']=$v['danyuan_id'];
|
|
|
+ $insert['hu_id']=$v['id'];
|
|
|
+ $insert['price']=$price;
|
|
|
+ $insert['true_price']=$price;
|
|
|
+ foreach ($list_time as $kn=>$vn){
|
|
|
+ $insert['start_time']=$vn['starttime'];
|
|
|
+ $insert['end_time']=$vn['endtime'];
|
|
|
+ $insert['createtime']=$insert['updatetime']=time();
|
|
|
+ CostBill::insert($insert);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|