this->_format_row($row); } protected function _format_row($row) { static $tenders_attrs = null; if($tenders_attrs === null){ $tenders_attrs = K::M('tenders/setting')->fetch_all(); } $title = ''; if($city = K::M('data/city')->city($row['city_id'])){ $row['city_name'] = $city['city_name']; $title = $city['city_name'].'房屋lovebet备用'; } if($area = K::M('data/area')->area($row['area_id'])){ $row['area_name'] = $area['area_name']; $title = $area['area_name'].'房屋lovebet备用'; } if($types = K::M('tenders/setting')->get_type()){ $title = ''; foreach($types as $k=>$v){ if($type = $tenders_attrs[$row[$k.'_id']]){ $row[$k.'_title'] = $type['name']; $title .= $type['name']; } } } if(empty($row['title'])){ $row['title'] = $title; } if($city_id = $row['city_id']){ if($city = K::M('data/city')->city($city_id)){ $row['city_name'] = $city['city_name']; } } if($area_id = $row['area_id']){ if($area = K::M('data/area')->area($area_id)){ $row['area_name'] = $area['area_name']; } } $row['status_title'] = K::M('misc/data')->yuyue($row['status']); $row['from_title'] = $this->_from_list[$row['from']]; $row['from_attr_key'] = 'tenders:'.$row['from']; $row['sign_info'] = unserialize($row['sign_info']); return $row; } protected function _check($data, $tenders_id=null) { if($data['zx_time']){ $data['zx_time'] = strtotime($data['zx_time']); } if($data['tx_time']){ $data['tx_time'] = strtotime($data['tx_time']); } return parent::_check($data, $tenders_id); } public function format_items_ext($items) { if(empty($items)){ return false; } $company_ids = array(); foreach((array)$items as $k=>$v){ $company_ids[$v['sign_company_id']] = $v['sign_company_id']; } $company_list = $tenders_list = array(); if($company_ids){ $company_list = K::M('company/company')->items_by_ids($company_ids); } foreach((array)$items as $k=>$v){ if(!$company = $company_list[$v['sign_company_id']]){ $company = array(); } $v['ext'] = array('company'=>$company); $items[$k] = $v; } return $items; } } ?>