find(); $reportDetailInfo = ReportDetail::where('report_id', $reportid)->select(); $inquiryInfo = Inquiry::where('id', $reportInfo['quot_id'])->find(); // $inquiryDetailInfo = Property_cert_info::where('quot_id', $reportInfo['quot_id'])->order('id', 'desc')->select(); $inquiryDetailInfo = Property_cert_info::where('quot_id', $reportInfo['quot_id'])->select(); $valuerInfo = Db::name('valuer')->field('name,mobile,certificate_number,mark,certificate,autograph')->whereIn('id', [$reportInfo['appraiser_id'], $reportInfo['appraiser2_id']])->select(); $attachmnet = new Attachment(); //注册房地产估价师 $valuerName = ''; $valuerimg = []; if (!empty($valuerInfo)) { $name_len = 0; foreach ($valuerInfo as $kkk=>$vvv) { if (mb_strlen($vvv['name'])>$name_len) { $name_len = mb_strlen($vvv['name']); } } $i = 1; foreach ($valuerInfo as &$value1) { // 报告pdf封面多个估价师姓名字数不同对字数少的的中间加空格排版版面处理 $name_arr = preg_split('/(?'; $value1['nod'] = $i++; if (!empty($value1['certificate'])) { $valuerimg[] = $value1['certificate']; } if (!empty($value1['autograph'])) { $value1['autograph'] = $attachmnet->getUrl($value1['autograph'])['url']; } } } //报告摘要照片 // $attachmnet = new Attachment(); $report_summary_img_ids = []; foreach ($reportDetailInfo as $key => $value) { if (!empty($value['report_summary_img_ids'])) { $summaryIds = explode(',', $value['report_summary_img_ids']); $report_summary_img_ids = $attachmnet->getUrls($summaryIds); } } $year = substr($reportInfo['report_no'], 0, 4); $report_no = explode('-', $reportInfo['report_no']); $pos_f = strpos($reportInfo['report_no'], '-'); $numberings = substr($reportInfo['report_no'], 4, $pos_f+4); $suffix = substr($reportInfo['report_no'], $pos_f+8); $gross_value = $eva_net_value = $eva_net_value2 = $anticiated_taxes = $t_added_tax = $t_urban_construction_tax = $t_education_surcharges = $t_education_surcharges_s = $t_education_surcharges_df = $t_deed_tax = $t_auction_fee = $t_stamp_duty = $t_land_value_added_tax = $t_individual_income_tax = $t_individual_income_tax_copy = $t_register_price = 0; $appraiserData = $resultData = $totalAppraiserData = $estate_basic = $houseInfo = $landInfo = $surveyData = $materialData = $loc_img_ids = $appraisal_img_ids = $house_cert_img_ids = $subjectProperty = $equityData = $simpleData = $simpleDataMulti = $profitData = $gyprofitData = $usage_str = $assessResult = $estateInfo = $estimated_transfer_tax = $t_transfer_tax = $gen_saleablility_desc = $indp_use_desc = $seg_transfer_desc = $dev_lv_desc = []; $owner_name = ''; $type_str = getDictionaryName('ORDER_TYPE', $inquiryInfo['type']); $surveyc = new SurveyC(); $options=$surveyc->surveyOptionsList(); $survey = new Survey(); $code = ''; $item_name = []; $nod = $znod = 1; $is_residential = 1; $ownership_type = 1; // 1:个人,2:公司 foreach ($inquiryDetailInfo as $key => $value) { $priceInfo = Db::name('return_price')->where('property_cert_info_id', $value['id'])->order('id', 'desc')->find(); $reDetail = Db::name('report_detail')->where('property_cert_info_id', $value['id'])->find(); $gross_value = $gross_value + $priceInfo['eva_total_value']; $eva_net_value = $eva_net_value + $priceInfo['eva_net_value']; $eva_net_value2 = $eva_net_value2 + $priceInfo['eva_net_value2']; $t_added_tax = $t_added_tax + $priceInfo['added_tax']; $t_urban_construction_tax = $t_urban_construction_tax + $priceInfo['urban_construction_tax']; $t_education_surcharges = $t_education_surcharges + $priceInfo['edu_surcharge']; $t_education_surcharges_s = $t_education_surcharges_s + round($priceInfo['edu_surcharge']*0.6); $t_education_surcharges_df = $t_education_surcharges_df + $priceInfo['edu_surcharge'] - round($priceInfo['edu_surcharge']*0.6); $t_deed_tax = $t_deed_tax + $priceInfo['deed_tax']; $t_auction_fee = $t_auction_fee + $priceInfo['auction_fee']; $t_stamp_duty = $t_stamp_duty + $priceInfo['stamp_duty']; $t_land_value_added_tax = $t_land_value_added_tax + $priceInfo['land_value_added_tax']; $t_individual_income_tax = $t_individual_income_tax + $priceInfo['personal_income_tax']; $t_individual_income_tax_copy = $t_individual_income_tax_copy + $priceInfo['personal_income_tax_copy']; $t_register_price = $t_register_price + $value['reg_price']; //预计税费 建行云取税费2 $total_tax = 0; if ($inquiryInfo['bank_name'] == '中国建设银行') { $anticiated_taxes = $anticiated_taxes + $priceInfo['total_taxes2']; $total_tax = $priceInfo['total_taxes2']; } else { $anticiated_taxes = $anticiated_taxes + $priceInfo['total_taxes1']; $total_tax = $priceInfo['total_taxes1']; } $surveyInfo = Survey::where('property_cert_info_id', $value['id'])->find(); $surveyDetailInfo = SurveyDetail::where('survey_id', $surveyInfo['id'])->find(); $reportDetailData = ReportDetail::where('property_cert_info_id', $value['id'])->find(); // 房产证号文字处理 $property_cert = ''; // $consult = Db::name('consult_record')->where(['property_cert_info_id'=>$value['id']])->find(); // $deed_number_str = Db::name('consult_record_det')->where(['id'=>$consult['consult_record_det_id']])->find(); // $deed_number_str = $deed_number_str['data_printResult']; // if (!$consult) { // // pg_report_detail.new_online_info // $deed_number_str = $reportDetailInfo['new_online_info']; // } $deed_number_str = $reportDetailData['new_online_info']; if (strpos($deed_number_str, ',') !== false) { $deed_number_str_array = explode(',', $deed_number_str); // if (strpos($deed_number_str_array[1], '证号') !== false) { // $deed_number_array = explode('证号', $deed_number_str_array[1]); // if (strpos($deed_number_array[1], '不动产权') !== false) { // $property_cert = $deed_number_array[1]; // } else { // $property_cert = '深房地字第'.$deed_number_array[1].'号'; // } // } foreach ($deed_number_str_array as $deed_k=>$deed_v) if (strpos($deed_v, '证号') !== false) { $deed_number_array = explode('证号', $deed_v); if (strpos($deed_v, '不动产权') !== false) { // $property_cert = $deed_number_array[1]; $property_cert = str_replace('(', '(', $deed_number_array[1]); $property_cert = str_replace(')', ')', $property_cert); } else { $property_cert = '深房地字第'.$deed_number_array[1].'号'; } } } else { $property_cert = !empty($value['year']) ? $value['year'] . $value['property_cert'] : $value['property_cert']; } $usage_name = getDictionaryName('HOUSE_USAGE', $value['usage']); //根据首套物业所在城市,获取报告code if (empty($code)) { if ($value['city'] == '北京') { $code = 'B'; } elseif ($value['city'] == '武汉') { $code = 'C'; } else { $code = 'A'; } } if (strpos($value['property_complex'], '㎡') !== false) { $property_complex = str_replace('㎡', '', $value['property_complex']); } else { $property_complex = $value['property_complex']; } //估 价 结 果 明 细 表 $data = []; $data['full_estate_name'] = $value['property_full_name'];//项目名称 $data['deed_number'] = $property_cert;//产权证号 $data['usage_str'] = $usage_name;//房屋用途 $data['size'] = $value['size'];//建筑面积 $data['assessment_price'] = number_format($priceInfo['eva_unit_price']);//评估单价 $data['gross_value'] = number_format($priceInfo['eva_total_value']);//市场价值 $data['net_worth'] = number_format($priceInfo['eva_net_value']);//抵押净值 1 $data['net_worth_tow'] = number_format($priceInfo['eva_net_value2']);//抵押净值 2 $data['market_price']=number_format($priceInfo['market_price']);//市场参考单价 $data['guide_price']=number_format($priceInfo['guide_price']);//二手房成交参考单价 $data['guide_total']=number_format($priceInfo['guide_price']*$value['size']); $data['guide_price_building'] = $reportDetailData['ref_unit_price_building'];//参考单价所属楼盘 $data['unit_price']=number_format($priceInfo['eva_unit_price']);//评估单价 $data['area'] = $reportDetailData['small_district_name'];//所在片区 $data['estate_name'] = $value['property_complex'];//所在楼盘 $data['total_price']=number_format($priceInfo['eva_total_value']);//评估总价 $data['estimated_taxes']=number_format($total_tax);//预计税费 $data['gross_worth']=number_format($eva_net_value);//抵押净值 $data['register_price']=number_format($value['reg_price'], 2);//登记价 $data['is_residence'] = $reDetail['is_residential']; $data['estimated_tax1']=number_format($priceInfo['total_taxes1']); $data['estimated_tax2']=number_format($priceInfo['total_taxes2']); $data['obligee_percent'] = $reDetail['obligee_percent'];//权利人 //中信银行-快速变现价值 if ($inquiryInfo['type'] == 1) { $rapid_roi_citic = round($priceInfo['eva_total_value']*0.7); } else { $rapid_roi_citic = round($priceInfo['eva_total_value']*0.6); } $data['rapid_roi_citic'] = number_format($rapid_roi_citic); if($reDetail['is_residential']==2){ $is_residential = 2; } $appraiserData[] = $data; //估 价 结 果 明 细 表(合计) $t_size = !empty($t_size) ? $t_size + $value['size'] : $value['size']; $t_gross_value = !empty($t_gross_value) ? $t_gross_value + $priceInfo['eva_total_value'] : $priceInfo['eva_total_value']; $t_net_worth = !empty($t_net_worth) ? $t_net_worth + $priceInfo['eva_net_value'] : $priceInfo['eva_net_value']; $t_net_worth_tow = !empty($t_net_worth_tow) ? $t_net_worth_tow + $priceInfo['eva_net_value2'] : $priceInfo['eva_net_value2']; $t_estimated_taxes = !empty($t_estimated_taxes) ? $t_estimated_taxes + $total_tax : $total_tax; $t_estimated_taxes_two = !empty($t_estimated_taxes_two) ? $t_estimated_taxes_two + $priceInfo['total_taxes2'] : $priceInfo['total_taxes2']; $t_gross_worth = !empty($t_gross_worth) ? $t_gross_worth + $eva_net_value : $eva_net_value; $t_guide_total = !empty($t_guide_total) ? $t_guide_total + $priceInfo['guide_price']*$value['size'] : $priceInfo['guide_price']*$value['size']; $t_rapid_roi_citic = !empty($t_rapid_roi_citic) ? $t_rapid_roi_citic + $rapid_roi_citic : $rapid_roi_citic; //竣工时间 $completion = strtotime($reDetail['completion_date']);//竣工时间戳 $restrict = strtotime('1970-01-01');//限制时间戳 $completion_date = !empty($reDetail['completion_date']) && $completion > $restrict ? date('Y年m月d日', $completion) : '****年**月**日'; //购买日期 $buy_date_unix = strtotime($reDetail['purchase_date']); $buy_restrict = strtotime('1899-11-30'); $purchase_date = !empty($reDetail['purchase_date']) && $buy_date_unix > $buy_restrict ? date('Y年m月d日', $buy_date_unix) : '——'; //估价结果明细 $data1 = []; $data1['full_estate_name'] = $value['property_full_name'];//项目名称 $data1['deed_number'] = $property_cert;//产权证号 $data1['usage_str'] = $usage_name;//房屋用途 $data1['size'] = $value['size'];//建筑面积 $data1['market_price'] = number_format($priceInfo['market_price']); $data1['guide_price'] = number_format($priceInfo['guide_price']); $data1['guide_price_total'] = number_format($priceInfo['guide_price']*$value['size']); $data1['assessment_price'] = number_format($priceInfo['eva_unit_price']);//评估单价 $data1['gross_value'] = number_format($priceInfo['eva_total_value']);//市场价值 $data1['net_worth'] = number_format($priceInfo['eva_net_value']);//抵押净值1 $data1['net_worth_tow'] = number_format($priceInfo['eva_net_value2']);//抵押净值2 $data1['area'] = $reportDetailData['small_district_name'];//所在片区 $data1['estate_name'] = $value['property_complex'];//所在楼盘 //$data1['buy_date'] = !empty($value['purchase_date']) ? date('Y年m月d日', strtotime($value['purchase_date'])) : date('Y年m月d日', strtotime($reDetail['purchase_date']));//房产取得时间 // $data1['buy_date'] = date('Y年m月d日', strtotime($reDetail['reg_date'])); $data1['buy_date'] = !empty($reDetail['purchase_date']) && $buy_date_unix > $buy_restrict ? date('Y年m月d日', $buy_date_unix) : date('Y年m月d日', strtotime($reDetail['reg_date'])); $data1['completion_date'] = $completion_date;//竣工时间 $data1['is_vacant'] = $reDetail['is_vacant'] == 1 ? '是' : '否';//是否空置 $data1['vacant_months'] = $reDetail['vacant_months']; $data1['is_through'] = $reDetail['is_connect_with_other'] == 2 ? '是' : '否'; $data1['is_self_built'] = $reDetail['is_self_built'] == 2 ? '是' : '否'; $data1['is_violation'] = $reDetail['is_illegal_building'] == 2 ? '是' : '否'; $data1['is_auction'] = $reDetail['is_arbitration'] == 2 ? '是' : '否'; $data1['is_consistent'] = $reDetail['is_consistent'] == 2 ? '是' : '否'; $data1['is_double'] = $reDetail['is_double_unit'] == 2 ? '是' : '否'; $data1['is_old_change'] = $reDetail['is_renovation']; $data1['is_verify_mb'] = $reDetail['is_impl_subject']; $data1['announcement_link'] = $reDetail['announce_link']; $data1['is_residence'] = $reDetail['is_residential']; $data1['is_double_plus'] = $reDetail['is_multi_unit'] == 2 ? '是' : '否'; $data1['is_darkroom'] = $reDetail['has_hidden_room'] == 2 ? '是' : '否'; $data1['is_rent'] = $surveyDetailInfo['parking_lot_usage'] == 3 ? '是' : '否'; $data1['is_inconsit_cond'] = $reDetail['is_inconsit_cond']; $data1['inconsistent_reason'] = $reDetail['inconsistent_reason']; $data1['register_price'] = number_format($value['reg_price'], 2); $data1['city'] = $value['city']; $data1['assessment_time'] = date('Y年m月d日', strtotime($reportInfo['appraisal_time'])); // 评估报告出具日期 $resultData[] = $data1; $structure = !empty($surveyDetailInfo) ? $surveyDetailInfo['structure'] : ''; $newness_rate = !empty($surveyDetailInfo) ? $surveyDetailInfo['newness_rate'] : ''; $decoration = !empty($surveyDetailInfo) ? $surveyDetailInfo['decoration'] : ''; $survey_time[] = !empty($value['survey_time']) ? strtotime(date('Y-m-d', strtotime($value['survey_time']))) : ''; $returnDateInfo = Db::name('return_price')->field('MIN(create_time) as min_time,MAX(create_time) as max_time') ->where('property_cert_info_id', $value['id'])->find(); //估价技术报告-房屋登记情况 $data2 = []; $data2['nod'] = $nod++;//序号 // $data2['obligee'] = $reportDetailData['obligee'];//权利人名称 $data2['obligee'] = $reportDetailData['obligee_percent'];//2023-4-12新增字段权利人份额 $data2['deed_number'] = $property_cert;//房地产权证号(不动产权证号) $data2['estate_name'] = $value['property_full_name'];//房地产名称 $data2['size'] = $value['size'];//建筑面积(㎡) $data2['register_price'] = $value['reg_price'];//建购价款(元) $data2['register_price_format'] = number_format($value['reg_price'], 2);//建购价款(元) $data2['usage_str'] = $usage_name;//房屋用途 $data2['use_source'] = $reportDetailData['use_right_source'];//权属来源 $data2['completion_date'] = $completion_date;//竣工时间 $data2['postscript_remarks'] = $reportDetailData['cert_remark'];//附记备注 $data2['buy_date'] = $reDetail['purchase_date']; $data2['buy_date_cn'] = date('Y年m月d日', strtotime($reDetail['purchase_date'])); $data2['register_time'] = $reDetail['reg_date']; $data2['register_time_cn'] = date('Y年m月d日', strtotime($reDetail['reg_date'])); $data2['explain'] = '——';//他项权利说明 $data2['structure'] = $structure ?: '——';//结构 $houseInfo[] = $data2; //估价技术报告-土地登记情况 $data3 = []; $data3['nod'] = $znod++;//序号 $data3['zdbh'] = $reportDetailData['parcel_no'];//宗地号 // $data3['zd_area'] = number_format($reportDetailData['parcel_area'], 2);//土地面积(㎡) $data3['zd_area'] = is_numeric($reportDetailData['parcel_area']) ? number_format($reportDetailData['parcel_area'], 2) : $reportDetailData['parcel_area'];//土地面积(㎡) $data3['land_location'] = $reportDetailData['land_location'];//土地位置 $data3['land_use'] = $reportDetailData['parcel_usage'];//土地用途 $land_use_enddate = new \DateTime($reportDetailData['land_use_end_time']); $max_land_use_years = empty($reportDetailData['max_land_use_years']) ? '不动产权证上未记载' : $reportDetailData['max_land_use_years'] . '年,从' .date('Y年m月d日', strtotime($reportDetailData['land_use_start_time'])) . '到' . $land_use_enddate->format('Y年m月d日') . '止'; $data3['land_use_year'] = $max_land_use_years;//土地使用年限 $landInfo[] = $data3; $report_completion_time = date('Y年m月d日', strtotime($reportInfo['valuation_time'])) . '到' . date('Y年m月d日', strtotime($reportInfo['appraisal_time'])); // 多套横向显示权属状况 $estate_basic[] = array_merge($data2, $data3); //估价对象区位状况描述与分析 $data4 = []; $data4['estate_name'] = str_replace(' ', '', $value['property_full_name']);;//估价对象 $data4['nearby_estate'] = str_replace(' ', '', $reportDetailData['adjacent_property']);//毗邻物业 $data4['bus_route'] = str_replace(' ', '', $reportDetailData['bus_lines']);//公交线路 $data4['estate_introduction'] = str_replace(' ', '', $reportDetailData['property_intro']);//物业介绍 $data4['directional_position'] = str_replace(' ', '', $reportDetailData['boundaries']);//四至 $data4['public_facility'] = str_replace(' ', '', $reportDetailData['pub_serv']);//公共服务设施 $data4['name'] = '表' . numToWordone($key + 1); $surveyData[] = $data4; $reportDetailData = ReportDetail::where('property_cert_info_id', $value['id'])->find(); //估价对象实物状况描述与分析 $data5 = []; $data5['name'] = '表' . numToWordone($key + 1); $data5['estate_name'] = $value['property_full_name'];//估价对象 $data5['zdbh'] = $reportDetailData['parcel_no'];// // $data5['zd_area'] = number_format($reportDetailData['parcel_area'], 2);// $data5['zd_area'] = is_numeric($reportDetailData['parcel_area']) ? number_format($reportDetailData['parcel_area'], 2) : $reportDetailData['parcel_area']; $data5['land_use'] = $reportDetailData['parcel_usage'];// $data5['shop_situation'] = '';//商铺状态 $data5['land_location'] = $reportDetailData['land_location'];//估价对象位置 $data5['house_str'] = $this->getHouseStatus($surveyDetailInfo['unit_type']);//户型 $data5['outdoor_scene'] = $surveyDetailInfo['exterior_view'];//外观 $data5['floor_total'] = $surveyDetailInfo['total_floors'];//总楼层 $data5['floor_number'] = $surveyDetailInfo['floor_no'];//估价对象楼层 if($surveyInfo['survey_type'] == 1){ $data5['use_source'] = Survey::getDictionaryName1('residence_parking_garage_status',$surveyDetailInfo['parking_lot_usage']);//现状使用状况 }else{ $usage_condition = Survey::getArrayField($surveyDetailInfo, ['usage_condition'],$options['shop']['shop_usage_status']); $data5['use_source'] = !empty($usage_condition['shop_usage_status']) ? $usage_condition['shop_usage_status'] : '——'; } $data5['house_status'] = getDictionaryName('HOUSE_status', $reportDetailData['house_condition']);//房屋状况 $data5['towards'] = Survey::getDictionaryName1('residence_towards',$surveyDetailInfo['towards']) ?: '——';//朝向 $data5['decoration'] = Survey::getDictionaryName1('residence_decoration_grade',$surveyDetailInfo['decoration']) ?: '——';//装修档次 $data5['size'] = $value['size'];// $data5['usage_str'] = getDictionaryName('HOUSE_USAGE', $value['usage']);// $data5['practical_usage_str'] = getDictionaryName_opa('residence_practical_application', $surveyDetailInfo['usage']); $data5['structure'] = $structure ?: '——';//结构 $data5['completion_date'] = $completion_date;//竣工时间 $data5['directional_position'] = $reportDetailData['boundaries'];//四至 $data5['new_rate'] = $surveyDetailInfo['newness_rate'];//成新率 $data5['new_rate_cn'] = Survey::getDictionaryName1('residence_new_rate', $surveyDetailInfo['newness_rate']);//成新率 $data5['survey_type'] = $surveyInfo['survey_type']; $data5['business_content'] = $surveyDetailInfo['business_content']; // 商业查勘备注(使用之前的经营内容字段) //判断商业或住宅 if ($surveyInfo['survey_type'] == 1) { //外墙 $exterior_wall = Survey::getOptionField($surveyDetailInfo, ['exterior_view'],$options['residence']['residence_outdoor_scene']); $data5['outside_wall'] = !empty($exterior_wall['value'][0]) ? implode('、', $exterior_wall['value']) : '——'; $living_room = $this->getFacilityName(Survey::getOptionField1($surveyDetailInfo, ['living_room', 'living_room_img_ids'],$options['residence'])); //内墙 $data5['inside_wall'] = !empty($living_room['interior_wall']) ? $living_room['interior_wall'] : '——'; //天花板 $data5['ceiling'] = !empty($living_room['ceiling']) ? $living_room['ceiling'] : '——'; //地面 $data5['ground'] = !empty($living_room['ground']) ? $living_room['ground'] : '——'; //门窗 $door_window = Survey::getOptionField($surveyDetailInfo, ['doorplate'],$options['residence']['residence_doorplate']); $data5['door_window'] = !empty($door_window['value'][0]) ? implode('、', $door_window['value']) : '——'; //卫生间 $bathroom = Survey::getOptionField1($surveyDetailInfo, ['bathroom'], $options['residence']); $bathroomValue = $this->getAllName($bathroom); $data5['bathroom'] = !empty($bathroomValue) ? implode(';', $bathroomValue) : '——'; //卫生间(多套横向显示) $bathroom_h = $this->getDataNameh(Survey::getOptionField1($surveyDetailInfo, ['bathroom'], $options['residence'])); $data5['bathroom_ceiling_h'] = !empty($bathroom_h['ceiling']) ? $bathroom_h['ceiling'] : '——';//天花 $data5['bathroom_wall_h'] = !empty($bathroom_h['wall']) ? $bathroom_h['wall'] : '——';//墙面 $data5['bathroom_ground_h'] = !empty($bathroom_h['ground']) ? $bathroom_h['ground'] : '——';//地面 $data5['bathroom_sanitary_h'] = !empty($bathroom_h['sanitary']) ? $bathroom_h['sanitary'] : '——';//洁具 //厨房 $kitchen = Survey::getOptionField1($surveyDetailInfo, ['kitchen'], $options['residence']); $kitchen = $this->getAllName($kitchen); $data5['kitchen'] = !empty($kitchen) ? implode(';', $kitchen) : '——'; //厨房(多套横向显示) $kitchen_h = $this->getDataNameh(Survey::getOptionField1($surveyDetailInfo, ['kitchen'], $options['residence'])); $data5['kitchen_ceiling_h'] = !empty($kitchen_h['ceiling']) ? $kitchen_h['ceiling'] : '——';//天花 $data5['kitchen_wall_h'] = !empty($kitchen_h['wall']) ? $kitchen_h['wall'] : '——';//墙面 $data5['kitchen_ground_h'] = !empty($kitchen_h['ground']) ? $kitchen_h['ground'] : '——';//地面 $data5['kitchen_equipment_h'] = !empty($kitchen_h['equipment']) ? $kitchen_h['equipment'] : '——';//设备 //空调 $facility = $this->getFacilityName(Survey::getOptionField1($surveyDetailInfo, ['facility'], $options['residence'])); $data5['conditioner'] = !empty($facility['conditioner']) ? $facility['conditioner'] : '——'; //水电 $data5['hydropower'] = !empty($facility['hydropower']) ? $facility['hydropower'] : '——'; //通讯 $data5['communication'] = !empty($facility['communication']) ? $facility['communication'] : '——'; //电梯 $data5['lift'] = !empty($surveyDetailInfo['elevator']) ? $surveyDetailInfo['elevator'] : '无'; //卧室 $bedroom = $this->getDataName(Survey::getOptionField1($surveyDetailInfo, ['bedroom'], $options['residence'])); $data5['bedroom_ceiling'] = !empty($bedroom['ceiling']) ? $bedroom['ceiling'] : '——';//天花板 $data5['bedroom_ground'] = !empty($bedroom['ground']) ? $bedroom['ground'] : '——';//地面 $data5['bedroom_inside_wall'] = !empty($bedroom['interior_wall']) ? $bedroom['interior_wall'] : '——';//内墙 } else { //外墙 $exterior_wall = Survey::getOptionField($surveyDetailInfo, ['exterior_wall'], $options['shop']['shop_outdoor_scene']); $data5['outside_wall'] = !empty($exterior_wall['value'][0]) ? implode('、', $exterior_wall['value']) : '——'; //内墙 $interior_wall = Survey::getOptionField($surveyDetailInfo, ['interior_wall'], $options['shop']['shop_parlour']); $data5['inside_wall'] = !empty($interior_wall['value'][0]) ? implode('、', $interior_wall['value']) : '——'; //天花板 $ceiling = Survey::getOptionField($surveyDetailInfo, ['ceiling'], $options['shop']['shop_balcony']); $data5['ceiling'] = !empty($ceiling['value'][0]) ? implode('、', $ceiling['value']) : '——'; //地面 $ground = Survey::getOptionField($surveyDetailInfo, ['ground'], $options['shop']['shop_kitchen']); $data5['ground'] = !empty($ground['value'][0]) ? implode('、', $ground['value']) : '——'; //门窗 $door_window = Survey::getOptionField($surveyDetailInfo, ['door_window'], $options['shop']['shop_door_window']); $data5['door_window'] = !empty($door_window['value'][0]) ? implode('、', $door_window['value']) : '——'; //卫生间 $bathroom = Survey::getOptionField1($surveyDetailInfo, ['bathroom'], $options['shop']['shop_toilet']); $bathroomValue = $this->getAllName($bathroom); $data5['bathroom'] = !empty($bathroomValue) ? implode(';', $bathroomValue) : '——'; //卫生间(多套横向显示) $bathroom_h = $this->getDataNameh(Survey::getOptionField1($surveyDetailInfo, ['bathroom'], $options['shop']['shop_toilet'])); $data5['bathroom_ceiling_h'] = !empty($bathroom_h['ceiling']) ? $bathroom_h['ceiling'] : '——';//天花 $data5['bathroom_wall_h'] = !empty($bathroom_h['wall']) ? $bathroom_h['wall'] : '——';//墙面 $data5['bathroom_ground_h'] = !empty($bathroom_h['ground']) ? $bathroom_h['ground'] : '——';//地面 $data5['bathroom_sanitary_h'] = !empty($bathroom_h['sanitary']) ? $bathroom_h['sanitary'] : '——';//洁具 //厨房 $kitchen = Survey::getOptionField1($surveyDetailInfo, ['kitchen'], $options['shop']['shop_kitchen2']); $kitchen = $this->getAllName($kitchen); $data5['kitchen'] = !empty($kitchen) ? implode(';', $kitchen) : '——'; //厨房(多套横向显示) $kitchen_h = $this->getDataNameh(Survey::getOptionField1($surveyDetailInfo, ['kitchen'], $options['shop']['shop_kitchen2'])); $data5['kitchen_ceiling_h'] = !empty($kitchen_h['ceiling']) ? $kitchen_h['ceiling'] : '——';//天花 $data5['kitchen_wall_h'] = !empty($kitchen_h['wall']) ? $kitchen_h['wall'] : '——';//墙面 $data5['kitchen_ground_h'] = !empty($kitchen_h['ground']) ? $kitchen_h['ground'] : '——';//地面 $data5['kitchen_equipment_h'] = !empty($kitchen_h['equipment']) ? $kitchen_h['equipment'] : '——';//设备 //空调 $facility = $this->getFacilityName($survey->getFacility($surveyDetailInfo, ['facility'], $options['shop']['shop_facilities']));//$this->getFacilityName(Survey::getOptionField1($surveyDetailInfo, ['facility'], $options['residence'])); $data5['conditioner'] = !empty($facility['conditioner']) ? $facility['conditioner'] : '——'; //水电 $data5['hydropower'] = !empty($facility['hydropower']) ? $facility['hydropower'] : '——'; //通讯 $data5['communication'] = !empty($facility['communication']) ? $facility['communication'] : '——'; //电梯 $data5['lift'] = !empty($facility['lift']) ? $this->getLift($facility['lift']) : '无'; //卧室 $bedroom = !empty($surveyDetailInfo['bedroom']) && $surveyDetailInfo['bedroom'] != "[]" ? $this->getDataName(Survey::getOptionField1($surveyDetailInfo, ['bedroom'], $options['residence'])) : []; $data5['bedroom_ceiling'] = !empty($bedroom['ceiling']) ? $bedroom['ceiling'] : '——';//天花板 $data5['bedroom_ground'] = !empty($bedroom['ground']) ? $bedroom['ground'] : '——';//地面 $data5['bedroom_inside_wall'] = !empty($bedroom['interior_wall']) ? $bedroom['interior_wall'] : '——';//内墙 } //客厅 $living_room = $this->getDataName(Survey::getOptionField1($surveyDetailInfo, ['living_room'], $options['residence'])); // $living_room = !empty($living_room) ? implode(';', $living_room) : '——'; $data5['living_ceiling'] = !empty($living_room['ceiling']) ? $living_room['ceiling'] : '——';//天花板 $data5['living_ground'] = !empty($living_room['ground']) ? $living_room['ground'] : '——';//地面 $data5['living_inside_wall'] = !empty($living_room['interior_wall']) ? $living_room['interior_wall'] : '——';//内墙 //其他 $other = Survey::getOptionField1($surveyDetailInfo, ['other'], $options['residence']); $other = $this->getFacilityName($other); $data5['other'] = !empty($other) ? implode('、', $other) : '——'; $data5['remark'] = $surveyDetailInfo['remarks'] ?: '——'; $data5['special_remarks'] = !empty($surveyDetailInfo['special_remarks']) ? $surveyDetailInfo['special_remarks'] : '0';//特殊户型备注 $materialData[] = $data5; //测算方法-比较法简单 案例 $simpleInfo = Db::name('method_simple')->field('id,property_cert_info_id,item,trade_date,building_name as estate_name,size,floor_number1,unit_type,floor_number2,price,transactions')->where('property_cert_info_id', $value['id'])->order('id', 'asc')->select(); if (!empty($simpleInfo) && empty($simpleData)) { $simpleData = $simpleInfo; } if (!empty($simpleInfo)) { $simpleDataMulti[] = $simpleInfo; } //税费 $data6 = []; $data6['name'] = numToWordone($key + 1); $data6['estate_name'] = $priceInfo['property_name'];//物业名称 $data6['size'] = $priceInfo['area'];//建筑面积 $data6['assessment_price'] = number_format(intval($priceInfo['eva_unit_price']));//评估单价 $data6['assessment_all_value'] = number_format(intval($priceInfo['eva_total_value']));//评估市值 $data6['register_price'] = number_format($value['reg_price'], 2);//登记价 $data6['added_tax'] = number_format(intval($priceInfo['added_tax']));//增值税 $data6['urban_construction_tax'] = number_format(intval($priceInfo['urban_construction_tax']));//城市维护建设税 $data6['education_surcharges'] = number_format(intval($priceInfo['edu_surcharge']));//教育费附加 $data6['stamp_duty'] = number_format(intval($priceInfo['stamp_duty']));//印花税 $data6['land_value_added_tax'] = number_format(intval($priceInfo['land_value_added_tax']));//土地增值税 $data6['individual_income_tax'] = number_format(intval($priceInfo['personal_income_tax']));//个人所得税 $data6['service_charge'] = number_format(intval($priceInfo['tran_service_fee']));//交易服务费 $data6['deed_tax'] = number_format(intval($priceInfo['deed_tax']));//契税 $data6['total_tax1'] = number_format(intval($total_tax));//税费合计 $data6['order_type'] = $inquiryInfo['type'];//询价类型 // 民生多套预计税费备注 $data6['individual_income_tax_copy'] = number_format(intval($priceInfo['personal_income_tax_copy']));//个人所得税 $data6['ms_total_tax'] = number_format(intval($total_tax+$priceInfo['personal_income_tax_copy'])); $data6['ms_total_net'] = number_format(intval($priceInfo['eva_total_value']-$total_tax-$priceInfo['personal_income_tax_copy'])); // 光大多套预计税费备注 $data6['gd_total_tax'] = number_format(intval($total_tax+$priceInfo['personal_income_tax_copy']+$priceInfo['added_tax'])); $data6['gd_total_net'] = number_format(intval($priceInfo['eva_total_value']-$total_tax-$priceInfo['personal_income_tax_copy']-$priceInfo['added_tax'])); $taxationData[] = $data6; //附件 //估价对象位置示意图 if (!empty($surveyDetailInfo['loc_img_ids'])) { // $location_imgs_ids[] = $surveyDetailInfo['loc_img_ids']; $location_imgs_ids[] = ['estate_name' => $value['property_full_name'], 'location_imgs' => $surveyDetailInfo['loc_img_ids']]; } //估价对象照片 if (!empty($surveyDetailInfo['appraisal_img_ids'])) { // $survey_gallery_imgs_ids[] = $surveyDetailInfo['appraisal_img_ids']; $survey_gallery_imgs_ids[] = ['estate_name' => $value['property_full_name'], 'survey_gallery_imgs' => $surveyDetailInfo['appraisal_img_ids']]; } //房产证复印件 if (!empty($reportDetailData['house_cert_img_ids'])) { // $house_img_ids[] = $reportDetailData['house_cert_img_ids']; $house_img_ids[] = ['estate_name' => $value['property_full_name'], 'house_img' => $reportDetailData['house_cert_img_ids']]; } //估价对象基本状况一览表(商铺) $data7 = []; $data7['name'] = numToWordone($key + 1); $data7['estate_name'] = $value['property_full_name']; $data7['property_addr'] = $reportDetailData['land_location']; $data7['deed_number'] = $property_cert; $data7['obligee'] = $reportDetailData['obligee']; $data7['register_price'] = number_format($value['reg_price'], 2); $data7['zdbh'] = $reportDetailData['parcel_no']; // $data7['zd_area'] = number_format($reportDetailData['parcel_area'], 2); $data7['zd_area'] = is_numeric($reportDetailData['parcel_area']) ? number_format($reportDetailData['parcel_area'], 2) : $reportDetailData['parcel_area']; $data7['land_use'] = $reportDetailData['parcel_usage']; $data7['directional_position'] = $reportDetailData['boundaries']; $data7['shop_situation'] = '规则多边形';//$survey->getShopStatus($surveyDetailInfo, ['shop_condition'], $options['shop']['shop_situation']); $data7['land_use_year'] = $max_land_use_years; $data7['condition'] = '已按规划建成,并已发证'; $data7['develop'] = '五通一平,地上建有建筑物'; $subjectProperty[] = $data7; //权益状况描述与分析(商铺) $data8 = []; $data8['name'] = numToWordone($key + 1); $data8['estate_name'] = $value['property_full_name']; $data8['zdbh'] = $reportDetailData['parcel_no']; $data8['land_use'] = $reportDetailData['parcel_usage']; $data8['land_use_year'] = $max_land_use_years; $data8['deed_number'] = $property_cert; $data8['usage_str'] = getDictionaryName('HOUSE_USAGE', $value['usage']); $data8['obligee'] = $reportDetailData['obligee']; $usage_condition = Survey::getArrayField($surveyDetailInfo, ['usage_condition'],$options['shop']['shop_usage_status']); $data8['shop_usage_status'] = !empty($usage_condition['shop_usage_status']) ? $usage_condition['shop_usage_status'] : '——'; $equityData[] = $data8; //收益法 $data9 = MethodProfit::where('property_cert_info_id', $value['id'])->find(); $contract_rent = 0; if ($data9) { $data9['month_profit'] = !empty($data9['month_profit']) ? $data9['month_profit'] : 0; $market_research = $data9['market_research']; $list = []; foreach ($market_research as $k => $v) { $list = []; if (!empty($v['house_imgs'])) { //获取图片信息 $list = $attachmnet->getUrl($v['house_imgs']); } if (!empty($v['islimit'])) { $contract_rent = $v['islimit']; } $market_research[$k]['house_imgs_url'] = !empty($list) ? $list['url'] : ''; } $data9['market_research'] = $market_research; $data9['estate_name'] = $value['property_full_name']; $data9['size'] = $value['size']; $data9['land_use_year'] = $max_land_use_years; $data9['num'] = numToWordone($key + 1); $data9['isNewCert'] = !empty($value['year'] );// 是否新证。此项为空为老证,反之是新不动产证。 $data9['new_rate_cn'] = Survey::getDictionaryName1('residence_new_rate', $surveyDetailInfo['newness_rate']);//成新率 $data9['deed_number'] = $property_cert; $data9['test_func'] = $reDetail['test_method']; $data9['contract_rent'] = $contract_rent; $data9['unit_price'] = number_format(intval($priceInfo['eva_unit_price']));//评估单价 $data9['assessment_all_value'] = number_format(intval($priceInfo['eva_total_value']));//评估市值 $profitData[] = $data9; } $data16 = Db::name('method_gyprofit')->where('property_cert_info_id='.$value['id'])->find(); if ($data16) { $data16['month_profit'] = !empty($data9['month_profit']) ? $data9['month_profit'] : 0; $market_research = $data9['market_research']; $list = []; foreach ($market_research as $k => $v) { $list = []; if (!empty($v['house_imgs'])) { //获取图片信息 $list = $attachmnet->getUrl($v['house_imgs']); } if (!empty($v['islimit'])) { $contract_rent = $v['islimit']; } $market_research[$k]['house_imgs_url'] = !empty($list) ? $list['url'] : ''; } $data16['market_research'] = $market_research; $data16['appraisal_object'] = $data9['appraisal_object']; $data16['estate_name'] = $value['property_full_name']; $data16['size'] = $value['size']; $data16['num'] = numToWordone($key + 1); $data16['test_func'] = $reDetail['test_method']; $data16['contract_rent'] = $contract_rent; $data16['unit_price'] = number_format(intval($priceInfo['eva_unit_price']));//评估单价 $data16['assessment_all_value'] = number_format(intval($priceInfo['eva_total_value']));//评估市值 $gyprofitData[] = $data16; } //当前时间 $current_date = $reportDetailData['addtime']; //建筑平面布局 $usage_str[] = getDictionaryName('HOUSE_USAGE', $value['usage']);//房屋用途 $item_name[] = $reportDetailData['land_location'] . $value['property_full_name'];//项目名称 $client_name[] = $reportDetailData['client'];//委托方 $data10 = []; $data10['full_estate_name'] = $value['property_full_name'];//项目名称 $data10['usage_str'] = $usage_name;//房屋用途 $data10['deed_number'] = $property_cert; $data10['isNewCert'] = !empty($value['year'] );// 是否新证。此项为空为老证,反之是新不动产证。 $assessResult[] = $data10; //物业概述 if ($reportDetailData['risk_remark']) { $estateInfo[] = $reportDetailData['risk_remark']; } //建行云贷多套预计税费表数据 $data11 = []; $data11['nod'] = $key + 1; $data11['full_estate_name'] = $value['property_full_name']; $data11['size'] = $priceInfo['area'];//建筑面积 $data11['register_price'] = number_format($value['reg_price'], 2);//登记价 $data11['assessment_price'] = number_format(intval($priceInfo['eva_unit_price']));//评估单价 $data11['assessment_all_value'] = number_format(intval($priceInfo['eva_total_value']));//评估市值 $data11['added_tax'] = number_format(intval($priceInfo['added_tax']));//增值税 $data11['urban_construction_tax'] = number_format(intval($priceInfo['urban_construction_tax']));//城市维护建设税 $data11['education_surcharges'] = number_format(intval($priceInfo['edu_surcharge']));//教育费附加 $data11['education_surcharges_s'] = number_format(round($priceInfo['edu_surcharge']*0.6)); $data11['education_surcharges_df'] = number_format($priceInfo['edu_surcharge']-round($priceInfo['edu_surcharge']*0.6)); $data11['deed_tax'] = number_format(intval($priceInfo['deed_tax']));//契税 $data11['stamp_duty'] = number_format(intval($priceInfo['stamp_duty']));//印花税 $data11['land_value_added_tax'] = number_format(intval($priceInfo['land_value_added_tax']));//土地增值税 $data11['individual_income_tax'] = number_format(intval($priceInfo['personal_income_tax']));//个人所得税 $data11['individual_income_tax_copy'] = number_format(intval($priceInfo['personal_income_tax_copy']));//个人所得税 $data11['service_charge'] = number_format(intval($priceInfo['tran_service_fee']));//交易服务费 $data11['auction_fee'] = number_format(intval($priceInfo['auction_fee']));//拍卖费 $data11['total_tax1'] = number_format(intval($total_tax));//税费合计 $data11['tenure_type'] = $value['ownership_type'];//产权人类型 $data11['total_tax2'] = number_format(intval($priceInfo['total_taxes2']));//税费2合计 $data11['net_worth'] = number_format(intval($priceInfo['eva_net_value'])); $data11['net_worth_tow'] = number_format(intval($priceInfo['eva_net_value2'])); if($value['ownership_type']==2){ $ownership_type = 2; } $estimated_transfer_tax[] = $data11; // 变现能力分析(多套) $data12 = []; $data12['universality_desc'] = $reDetail['gen_saleablility_desc']; $gen_saleablility_desc[] = $data12; $data13 = []; $data13['indep_usability_desc'] = $reDetail['indp_use_desc']; $indp_use_desc[] = $data13; $data14 = []; $data14['divi_transferability_desc'] = $reDetail['seg_transfer_desc']; $seg_transfer_desc[] = $data14; $data15 = []; $data15['degree_develop_desc'] = $reDetail['dev_lv_desc']; $dev_lv_desc[] = $data15; } //预计转让税费参考明细表(合计) $t_transfer_tax['nod'] = '——'; $t_transfer_tax['full_estate_name'] = '合计'; $t_transfer_tax['size'] = $t_size; $t_transfer_tax['register_price'] = number_format($t_register_price, 2); $t_transfer_tax['assessment_price'] = '——'; $t_transfer_tax['assessment_all_value'] = number_format($t_gross_value); $t_transfer_tax['added_tax'] = number_format($t_added_tax); $t_transfer_tax['urban_construction_tax'] = number_format($t_urban_construction_tax); $t_transfer_tax['education_surcharges'] = number_format($t_education_surcharges); $t_transfer_tax['education_surcharges_s'] = number_format($t_education_surcharges_s); $t_transfer_tax['education_surcharges_df'] = number_format($t_education_surcharges_df); $t_transfer_tax['deed_tax'] = number_format($t_deed_tax); $t_transfer_tax['auction_fee'] = number_format($t_auction_fee); $t_transfer_tax['stamp_duty'] = number_format($t_stamp_duty); $t_transfer_tax['land_value_added_tax'] = number_format($t_land_value_added_tax); $t_transfer_tax['individual_income_tax'] = number_format($t_individual_income_tax); $t_transfer_tax['individual_income_tax_copy'] = number_format($t_individual_income_tax_copy); $t_transfer_tax['total_tax1'] = number_format($t_estimated_taxes); $t_transfer_tax['total_tax2'] = number_format($t_estimated_taxes_two); $t_transfer_tax['net_worth'] = number_format($t_net_worth); $t_transfer_tax['net_worth_tow'] = number_format($t_net_worth_tow); $estimated_transfer_tax = array_merge($estimated_transfer_tax, [$t_transfer_tax]); //估 价 结 果 明 细 表(合计) $totalAppraiserData['full_estate_name'] = '合计'; $totalAppraiserData['deed_number'] = '——'; $totalAppraiserData['usage_str'] = '——'; $totalAppraiserData['size'] = $t_size; $totalAppraiserData['assessment_price'] = '——'; $totalAppraiserData['market_price'] = '----'; $totalAppraiserData['guide_price'] = '----'; $totalAppraiserData['guide_total'] = '----'; $totalAppraiserData['guide_price_building'] = '----'; $totalAppraiserData['gross_value'] = number_format($t_gross_value); $totalAppraiserData['net_worth'] = number_format($t_net_worth); $totalAppraiserData['unit_price'] = '——'; $totalAppraiserData['net_worth_tow'] = number_format($t_net_worth_tow); $totalAppraiserData['estimated_taxes'] = number_format($t_estimated_taxes); $totalAppraiserData['gross_worth'] = number_format($t_gross_worth); $totalAppraiserData['area'] = '——'; $totalAppraiserData['estate_name'] = '——'; $totalAppraiserData['rapid_roi_citic'] = number_format($t_rapid_roi_citic); $totalAppraiserData['estimated_tax1']=number_format($t_estimated_taxes); $totalAppraiserData['estimated_tax2']=number_format($t_estimated_taxes_two); $totalAppraiserData['register_price'] = number_format($t_register_price, 2); $totalAppraiserData['obligee_percent'] = '——'; $appraiserData = array_merge($appraiserData, [$totalAppraiserData]); $gross_value_str = convertAmountToCn($gross_value, $type = 1); $gross_value = number_format($gross_value); $net_worth_str = convertAmountToCn($eva_net_value, $type = 1); $eva_net_value = number_format($eva_net_value); $net_worth_tow_str = convertAmountToCn($eva_net_value2, $type = 1); $eva_net_value2 = number_format($eva_net_value2); $appraisal_time = !empty($reportInfo['appraisal_time']) ? explode('-', $reportInfo['appraisal_time']) : ''; $info = []; $info['is_residence'] = $is_residential; $info['tenure_type'] = $ownership_type; $info['otherrights_type'] = $this->getOtherRightsType($reportInfo['otherrights_type']);//他项权利说明 $info['otherrights_type_int'] = $reportInfo['otherrights_type']; $info['DFFA_desc'] = $this->getDFFADesc( $reportInfo['otherrights_type']); // 背离事实假设描述 $info['p_added_tax'] = number_format($t_added_tax); $info['p_urban_construction_tax'] = number_format($t_urban_construction_tax); $info['p_education_surcharges'] = number_format($t_education_surcharges); $info['p_education_surcharges_s'] = number_format($t_education_surcharges_s); $info['p_education_surcharges_df'] = number_format($t_education_surcharges_df); $info['p_deed_tax'] = number_format($t_deed_tax); $info['p_auction_fee'] = number_format($t_auction_fee); $info['p_stamp_duty'] = number_format($t_stamp_duty); $info['p_land_value_added_tax'] = number_format($t_land_value_added_tax); $info['p_individual_income_tax'] = number_format($t_individual_income_tax); $info['p_individual_income_tax_copy'] = number_format($t_individual_income_tax_copy); //第一页 $info['extract'] = $reportInfo['e_case_code'];//电子报告提取码 $info['report_no'] = '深国中评字['.$year.$code.']第'.$numberings.'号'.$suffix;//估价报告编号 $info['item_name'] = implode("、", $item_name);//估价项目名称 $info['item_name_index'] = $item_name[0] . '等共' . count($item_name) . '套';//估价项目名称(多套首页) $info['client_name'] = implode('、', array_unique($client_name));//估价委托人 $info['employee_name'] = $valuerName;//注册房地产估价师 // $info['finish_date'] = !empty($reportInfo['completion_time']) ? date('Y年m月d日', $reportInfo['completion_time']) : '';//估价报告出具日期 $info['finish_date'] = !empty($reportInfo['appraisal_time']) ? date('Y年m月d日', strtotime($reportInfo['appraisal_time'])) : '';//估价报告出具日期 $info['order_type'] = getDictionaryName('ORDER_TYPE', $inquiryInfo['type']);//订单类型 $info['usage_str'] = implode('、', array_unique($usage_str));//建筑平面布局 $info['property_name'] = !empty($inquiryDetailInfo) ? $inquiryDetailInfo[0]['property_full_name'] : ''; $info['estate_info'] = ''; if (!empty($inquiryDetailInfo)) { $estate_info = $this->array_column($inquiryDetailInfo, 'property_full_name'); unset($estate_info[0]); $info['estate_info'] = implode(',', $estate_info); } $info['report_QR_code'] = $reportInfo['report_qrcode'];//防伪二维码 //第二页 $info['report_summary_img'] = $report_summary_img_ids;//摘要 // 民生银行拍卖费 $info['ms_pm'] = number_format(round($t_gross_value*6/100)); // 民生银行公证费 $info['ms_gz'] = number_format(round($t_gross_value*3/1000)); // 民生银行转移登记费 $info['ms_transfer'] = number_format(round($t_gross_value*1/1000)); // 民生银行拍卖费+公证费+转移登记费 $ms_total = round($t_gross_value*6/100) + round($t_gross_value*3/1000) + round($t_gross_value*1/1000); $info['ms_total'] = number_format($ms_total); //第三页 $info['cost_date'] = !empty($reportInfo['valuation_time']) ? date('Y年m月d日', strtotime($reportInfo['valuation_time'])) : '';//价值时点 $info['cost_date_cn'] = !empty($reportInfo['valuation_time']) ? date('Y年m月d日', strtotime($reportInfo['valuation_time'])):'';//价值时点 $info['gross_value_str'] = $gross_value_str;//市场价值文本 $info['net_worth_str'] = $net_worth_str;//抵押净值1文本 $info['net_worth_tow_str'] = $net_worth_tow_str;//抵押净值2文本 $info['gross_value'] = $gross_value;//市场价值 $info['net_worth'] = $eva_net_value;//抵押净值1 $info['net_worth_tow'] = $eva_net_value2;//抵押净值2 $info['cost_time'] = !empty($reportInfo['valuation_time']) ? date('Y/m/d', strtotime($reportInfo['valuation_time'])) : '';//价值时点 $info['appraiserData'] = $appraiserData;//估 价 结 果 明 细 表 $info['t_guide_total'] = number_format($t_guide_total);//指导价参考总价值 $info['finish_date_cn'] = !empty($appraisal_time) ? numToWordone($appraisal_time[0]) .'年'. numToWordone(intval($appraisal_time[1])) .'月'. numToWordone(intval($appraisal_time[2])) . '日' : '';//二〇二〇年五月九日 $building_name = $this->array_column($inquiryDetailInfo, 'property_full_name'); $estate_num = count($building_name); $info['estate_num'] = $estate_num; $info['estate_name'] = implode('、', $building_name) . '共' . numToWordone($estate_num) . '套';//致估价委托人函物业名称 $info['evaluate_purpose'] = $inquiryInfo['eva_purpose']; $owner_name = $this->array_column($inquiryDetailInfo, 'owner_name'); $info['owner_name'] = implode('、', array_unique($owner_name)); $info['estimated_taxes_cn'] = convertAmountToCn($anticiated_taxes);//预计税费文本 $info['estimated_taxes'] = number_format($anticiated_taxes);//预计税费 $info['estimated_taxes2_cn'] = convertAmountToCn($t_estimated_taxes_two); $info['estimated_taxes2'] = number_format($t_estimated_taxes_two); $info['size'] = $t_size; $info['gujia_result_remark'] = $reportInfo['appraisal_result_remark']; $info['rapid_roi_citic'] = number_format($t_rapid_roi_citic); $info['rapid_roi_citic_str'] = convertAmountToCn($t_rapid_roi_citic); $info['statutory_payment'] = 0; //第四页 $info['resultData'] = $resultData;//估价结果明细 foreach ($resultData as $k_key=>$v_value){ if($v_value['is_inconsit_cond']==2){ $info['resultData'][0]['is_inconsit_cond'] = $v_value['is_inconsit_cond']; $info['resultData'][0]['inconsistent_reason'] = $v_value['inconsistent_reason']; } } $info['assessResult'] = $assessResult; //第五页 $info['estateInfo'] = $estateInfo;//物业概况 $info['orderType'] = $inquiryInfo['type'];//订单类型 住宅 商业 //第六页 $info['valuerInfo'] = $valuerInfo;//估计师信息 //第七页 //有效期 $evaluation_date = $reportInfo['appraisal_time']; $info['valid_date'] = date('Y年m月d日', strtotime($reportInfo['appraisal_time'])) . '至' . date('Y年m月d日', strtotime("$evaluation_date +1 year -1 day")); //第八页 //房屋登记情况 $info['houseInfo'] = $houseInfo; //土地登记情况 $info['landInfo'] = $landInfo; //多套横向显示权属状况 $info['estate_basic'] = $estate_basic; //估价对象区位状况描述与分析 $info['surveyData'] = $surveyData; //估价对象区位状况描述与分析 $info['materialData'] = $materialData; //第九页 $info['subjectProperty'] = $subjectProperty; $info['market_background'] = $reportInfo['market_background']; //第十页 //市场背景 $market = Db::name('market_background')->where('status', 1)->whereIn('type', $reportInfo['market_background'])->group('type')->order('id', 'desc')->select(); foreach ($market as $mKey => $mValue) { $market[$mKey]['num'] = numToWordone($mKey + 1); } $info['backgroundData'] = $market; //第十一页 if ($survey_time) { $max_time = max($survey_time); $min_time = min($survey_time); if ($max_time == $min_time) { $survey_time = date('Y年m月d日', $max_time); } else { $survey_time = date('Y年m月d日', $min_time) . '至' . date('Y年m月d日', $max_time); } } $info['survey_time'] = $survey_time;//查勘时间 $info['report_time'] = $report_completion_time;//报告时间 //第十二页 $info['equityData'] = $equityData; //第十三页 //第十四页 //第十五页 if ($simpleData) { foreach ($simpleData as &$value) { $pInfo = Db::name('return_price')->field('property_name,unit_no,area,eva_unit_price,eva_total_value') ->where('property_cert_info_id', $value['property_cert_info_id'])->order('id', 'desc')->find(); $value['property_name'] = $pInfo['property_name']; $value['house_number'] = $pInfo['unit_no']; $value['assessment_price'] = number_format($pInfo['eva_unit_price']); $value['area'] = $pInfo['area']; $value['assessment_all_value'] = number_format($pInfo['eva_total_value']); // $value['size'] = intval($value['size']); $value['size'] = $value['size']; $value['price'] = number_format($value['price']); } } else { $simpleData[] = array( 'item' => '', 'trade_date' => '', 'estate_name' => '', 'size' => '', 'floor_number1' => '', 'apartment' => '', 'price' => '', 'transactions' => '', 'property_name' => '', 'assessment_price' => '', 'area' => '', 'assessment_all_value' => '' ); } $info['simpleData'] = $simpleData;//测算方法-比较法简易 if ($simpleDataMulti) { foreach ($simpleDataMulti as &$v_multi) { foreach ($v_multi as &$valueMulti) { $pInfo = Db::name('return_price')->field('property_name,unit_no,area,eva_unit_price,eva_total_value')->where('property_cert_info_id', $valueMulti['property_cert_info_id'])->order('id', 'desc')->find(); $formalInfo = Db::name('method_formal')->field('transaction_instance,transaction_situation,transaction_date,area_situation,equity_situation,matter_situation,total_situation')->where('property_cert_info_id', $valueMulti['property_cert_info_id'])->order('id', 'asc')->find(); if(!empty($formalInfo)){ foreach ($formalInfo as &$formalC) { $formalC=json_decode($formalC,true); } } $valueMulti['formalData'] = $formalInfo; $valueMulti['property_name'] = $pInfo['property_name']; $valueMulti['house_number'] = $pInfo['unit_no']; $valueMulti['assessment_price'] = number_format($pInfo['eva_unit_price']); $valueMulti['area'] = $pInfo['area']; $valueMulti['assessment_all_value'] = number_format($pInfo['eva_total_value']); // $valueMulti['size'] = intval($valueMulti['size']); $valueMulti['size'] = $valueMulti['size']; $valueMulti['price'] = number_format($valueMulti['price']); } } } else { $simpleDataMulti[][] = array( 'item' => '', 'trade_date' => '', 'estate_name' => '', 'size' => '', 'floor_number1' => '', 'apartment' => '', 'price' => '', 'transactions' => '', 'property_name' => '', 'assessment_price' => '', 'area' => '', 'assessment_all_value' => '' ); } $info['simpleDataMulti'] = $simpleDataMulti;//测算方法-比较法简易(多套) //第十六页 $info['profitData'] = $profitData;//测算方法-收益法 $info['gyprofitData'] = $gyprofitData;//测算方法-收益法 $info['one_year'] = date('Y年', strtotime("$current_date -1 year")) . '平均月租金(元/平方米/月)'; $info['two_year'] = date('Y年', strtotime("$current_date -2 year")) . '平均月租金(元/平方米/月)'; $info['three_year'] = date('Y年', strtotime("$current_date -3 year")) . '平均月租金(元/平方米/月)'; //第十七页 //税费信息 $info['taxationData'] = $taxationData; //预计转让税费 $info['estimated_transfer_tax'] = $estimated_transfer_tax; $info['ccb_tax1'] = number_format($t_deed_tax); $info['ccb_tax2'] = number_format($t_estimated_taxes); //第十八页 //物业位置图 $loc_img_ids = []; if (!empty($location_imgs_ids)) { foreach ($location_imgs_ids as $lk => $lv) { $locationIds = explode(',', $lv['location_imgs']); $loc_img_ids[] = ['name' => numToWordone($lk + 1), 'info' => $attachmnet->getUrls($locationIds), 'estate_name' => $lv['estate_name']]; } } $info['location_imgs'] = $loc_img_ids; //第十九页 //查勘图库 //估价对象照片 $appraisal_img_ids = []; if (!empty($survey_gallery_imgs_ids)) { foreach ($survey_gallery_imgs_ids as $sk => $sv) { $allIds = []; $allIds = explode(',', $sv['survey_gallery_imgs']); // if (count($allIds) >= 12) {//大于等于12时,取12张图片 // $allIds = array_slice($allIds, 0, 12); // } elseif (count($allIds) >= 8 && count($allIds) < 12) {//大于等于8且小于12时,取8张图片 // $allIds = array_slice($allIds, 0, 8); // } else {//否则,取6张图片 // $allIds = array_slice($allIds, 0, 6); // } $appraisal_img_ids[] = ['name' => numToWordone($sk + 1), 'info' => $attachmnet->getUrls(array_filter($allIds)), 'estate_name' => $sv['estate_name']]; } } $info['survey_gallery_imgs'] = $appraisal_img_ids; //第二十页 //房产证照 //房产证复印件 $house_cert_img_ids = []; if (!empty($house_img_ids)) { foreach ($house_img_ids as $hk => $hv) { $houseIds = explode(',', $hv['house_img']); $house_cert_img_ids[] = ['name' => numToWordone($hk + 1), 'info' => $attachmnet->getUrls($houseIds), 'estate_name' => $hv['estate_name']]; } } $info['house_img'] = $house_cert_img_ids; //公司 $company_img = [ // array('url' => 'https://test-cspg.oss-cn-shenzhen.aliyuncs.com/uploads/20200902/d77a31b4e8cbee20c4b310df77cf125c.png'), // 营业执照 // array('url' => 'https://test-cspg.oss-cn-shenzhen.aliyuncs.com/uploads/20200902/e24877f47b6209cce1d0d6efa6fef27c.png'), // 变更(备案)通知书 // array('url' => Env::get('uploadFile.host_url') . DS . 'image' . DS .'business_license2.jpg'), // 变更(备案)通知书 array('url' => Env::get('uploadFile.host_url') . DS . 'image' . DS .'business_license1.jpg'), //array('url' => Env::get('uploadFile.host_url') . DS . 'image' . DS .'business_license2.png'), // 营业执照 2022-06-28 // array('url' => 'https://test-cspg.oss-cn-shenzhen.aliyuncs.com/uploads/20200902/change_notification.jpeg'), // 变更(备案)通知书 2022-06-28 array('url' => Env::get('uploadFile.host_url') . DS . 'image' . DS .'business_license3.jpg') ]; $info['company_img'] = $company_img; //估价师证件 $valuer_img = []; if (!empty($valuerimg)) { $valuer_img = $attachmnet->getUrls($valuerimg); } $info['valuer_img'] = $valuer_img; // 光大银行签收表 $info['bank_name'] = $inquiryInfo['bank_name']; $info['ceb_branch_bank_name'] = $inquiryInfo['bank_sub_name']; $info['ceb_product_type'] = !empty($reportInfo['ceb_product_type']) ? getDictionaryName('CEB_PRODUCT_TYPE', $reportInfo['ceb_product_type']) : ''; // 贷款品种 $info['ceb_estate_name'] = implode('/', $building_name); // 评估物业名称(简称) $ceb_obligee = $this->array_column($reportDetailInfo, 'obligee'); $info['ceb_obligee'] = implode('/', $ceb_obligee); // 抵押人姓名 $test_func_arr = $this->array_column($reportDetailInfo, 'test_method'); $test_func_str = implode(',', $test_func_arr); if (strpos($test_func_str, '1') !== false && strpos($test_func_str, '2') !== false) { $info['test_func_str'] = '比较法、收益法'; } elseif (strpos($test_func_str, '2') !== false) { $info['test_func_str'] = '收益法'; } else { $info['test_func_str'] = '比较法'; } // 变现能力分析(多套) $info['universality_desc'] = $gen_saleablility_desc; $info['indep_usability_desc'] = $indp_use_desc; $info['divi_transferability_desc'] = $seg_transfer_desc; $info['degree_develop_desc'] = $dev_lv_desc; $info['is_court'] = 1;//多套默认非法院评估 return $info; } /** * 他项权利说明类型 * * @var array */ public static $OTHERRIGHTS_TYPE = ['','已抵押未注销','未抵押','查封','--']; /** * 背离事实假设的描述 * 对应 ['','已抵押未注销','未抵押'] * @var array */ public static $DFFA_DESC = ['根据委托方提供的《不动产权证书》复印件和深圳市房地产信息系统的产权查档情况,估价对象已进行抵押登记并尚未注销,根据贷款银行惯例,办理抵押贷款之前原有抵押关系必须先注销,本次评估基于估价对象原有抵押关系在本次办理抵押贷款前已注销', '根据估价目的及注册房地产估价师的实地查勘情况,估价对象设定状况与实际状况无不一致情况,故本次估价无背离事实假设。', '根据估价目的及注册房地产估价师的实地查勘情况,估价对象设定状况与实际状况无不一致情况,故本次估价无背离事实假设。', '根据估价目的及注册房地产估价师的实地查勘情况,估价对象设定状况与实际状况无不一致情况,故本次估价无背离事实假设。', '根据估价目的及注册房地产估价师的实地查勘情况,估价对象设定状况与实际状况无不一致情况,故本次估价无背离事实假设。']; /** * 获取背离事实假设的类型的文字描述 * * @param [type] $type * @return string */ public function getOtherRightsType( $type ){ //if(empty($type) || $type <=0 || $type >count(OffsiteTwoTemplate::$OTHERRIGHTS_TYPE)) if( null == $type || $type <=0 ) return ""; return OffsiteTwoTemplate::$OTHERRIGHTS_TYPE[$type]; } /** * 获取背离事实假设的文字描述 * * @param [type] $type * @return string */ public function getDFFADesc( $type ){ //$DESC = ['已抵押未注销','未抵押','查封']; if( empty($type) || $type <=0 || $type >count(OffsiteTwoTemplate::$DFFA_DESC) ) return ""; return OffsiteTwoTemplate::$DFFA_DESC[$type]; } //多位数组获取列数据 public function array_column($rows, $column_key, $index_key = null) { $data = []; foreach ($rows as $row) { if (empty($index_key)) { $data[] = $row[$column_key]; } else { $data[$row[$index_key]] = $row[$column_key]; } } return $data; } //合并信息 public function getAllName($data) { $result = []; if (empty($data['value'])) return $result; foreach ($data['value'] as $key => $value) { if (!empty($value['value'])) { $list = $value['name'] . ':' . implode('、', array_filter($value['value'])); $result[] = $list; } } return $result; } //获取设施 public function getFacilityName($data) { $result = []; if (empty($data['value'])) return $result; foreach ($data['value'] as $key => $value) { if (!empty($value)) { if (!empty($value['value']) && count(array_filter($value['value'])) >= 1 ) { if ($value['name'] == '空调') { $result['conditioner'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '水电') { $result['hydropower'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '通讯') { $result['communication'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '电梯') { $result['lift'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '其他') { $result['other'] = implode('、', array_filter($value['value'])); } } } } return $result; } //获取电梯 public function getLift($lift) { $arr = $result = []; if ($lift) { $lift = explode('、', $lift); foreach ($lift as $lk => $lv) { if (strstr($lv, "客梯")) { preg_match_all('/\d+/', $lv, $arr); } } } if (!empty($arr)) { $result = join('',$arr[0]); } else { $result = ''; } return $result; } //服务设施 public function getPublicFacility($data) { $result = []; $arr = ['bank', 'club', 'park', 'hotel', 'school', 'hospital', 'food_market', 'post_office', 'supermarket']; foreach ($arr as $key => $value) { if (!empty($data[$value])) { $result[] = $data[$value]; } } return implode('、', $result); } //四至 public function getDirectional($data) { $result = []; $arr = json_decode($data, true); if ($arr) { if (!empty($arr['east'])) { $result[] = '东至' . $arr['east']; } if(!empty($arr['west'])) { $result[] = '西至' . $arr['west']; } if(!empty($arr['south'])) { $result[] = '南至' . $arr['west']; } if(!empty($arr['north'])) { $result[] = '北至' . $arr['north']; } } return implode('、', $result); } //获取数据信息 public function getDataName($data) { $result = []; if (empty($data['value'])) return $result; foreach ($data['value'] as $key => $value) { if (!empty($value)) { if (count(array_filter($value['value'])) >= 1 ) { if ($value['name'] == '天花板') { $result['ceiling'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '地面') { $result['ground'] = implode('、', array_filter($value['value'])); } elseif($value['name'] == '内墙') { $result['interior_wall'] = implode('、', array_filter($value['value'])); } } } } return $result; } //获取横向显示数据信息 public function getDataNameh($data) { $result = []; if (empty($data['value'])) return $result; foreach ($data['value'] as $key => $value) { if (!empty($value)) { if (count(array_filter($value['value'])) >= 1 ) { if($value['name'] == '地面') { $result['ground'] = implode('、', array_filter($value['value'])); }elseif($value['name'] == '墙面') { $result['wall'] = implode('、', array_filter($value['value'])); }elseif($value['name'] == '天花') { $result['ceiling'] = implode('、', array_filter($value['value'])); }elseif($value['name'] == '设备') { $result['equipment'] = implode('、', array_filter($value['value'])); }elseif($value['name'] == '洁具') { $result['sanitary'] = implode('、', array_filter($value['value'])); } } } } return $result; } //获取户型 public function getHouseStatus($data) { $result = $data; $data = explode('-', $data); if (is_array($data) && count($data) == 4) { $room = !empty($data[0]) && $data[0] > 0 ? $data[0] . "房" : ''; $hall = !empty($data[1]) && $data[1] > 0 ? $data[1] . "厅" : ''; $toilet = !empty($data[2]) && $data[2] > 0 ? $data[2] . "卫" : ''; $balcony = !empty($data[3]) && $data[3] > 0 ? $data[3] . "阳台" : ''; $result = $room . $hall . $toilet . $balcony; } return $result; } }