<?php
class flow_suppClassModel extends flowModel
{
	public function initModel()
	{
		$this->statearr		 = c('array')->strtoarray('停用|#888888,启用|green');
		$this->statarr		 = c('array')->strtoarray('否|#888888,是|#ff6600');
	}
	
	//高级搜索下
	public function flowsearchfields()
	{
		$arr[] = array('name'=>'所属人...','fields'=>'uid');
		$arr[] = array('name'=>'创建人...','fields'=>'createid');
		return $arr;
	}
	
	public function flowrsreplace($rs, $lx=0)
	{
		//详情时，移动端
		if($lx==1 && $this->rock->ismobile()){

			if(!isempt($rs['mobile']))$rs['mobile']='<a onclick="return callPhone(this)" href="tel:'.$rs['mobile'].'">'.$rs['mobile'].'</a>';
			if(!isempt($rs['tel']))$rs['tel']='<a onclick="return callPhone(this)" href="tel:'.$rs['tel'].'">'.$rs['tel'].'</a>';
		}
	    if($rs['supplier_group']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['supplier_group']."'");
	    	$rs['supplier_group']=$data['name'];
	    }
	     if($rs['company_classify']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['company_classify']."'");
	    	$rs['company_classify']=$data['name'];
	    }
	     if($rs['company_nature']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['company_nature']."'");
	    	$rs['company_nature']=$data['name'];
	    }
	     if($rs['company_scale']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['company_scale']."'");
	    	$rs['company_scale']=$data['name'];
	    }
	      if($rs['correspond_org_id']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['correspond_org_id']."'");
	    	$rs['correspond_org_id']=$data['name'];
	    }
	    
	      if($rs['pay_currency']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['pay_currency']."'");
	    	$rs['pay_currency']=$data['name'];
	    }

	     if($rs['settle_type']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['settle_type']."'");
	    	$rs['settle_type']=$data['name'];
	    }
	     if($rs['pay_condition']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['pay_condition']."'");
	    	$rs['pay_condition']=$data['name'];
	    }
	    if($rs['tax_type']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['tax_type']."'");
	    	$rs['tax_type']=$data['name'];
	    }
	     if($rs['tend_type']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['tend_type']."'");
	    	$rs['tend_type']=$data['name'];
	    }
	     if($rs['tax_rate']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['tax_rate']."'");
	    	$rs['tax_rate']=$data['name'];
	    }
	     if($rs['bank_currency']){
	    	$data=$this->db->getone('oa_option',"num='".$rs['bank_currency']."'");
	    	$rs['bank_currency']=$data['name'];
	    }
            if($rs['trade']){
                $data=$this->db->getone('oa_option',"num='".$rs['trade']."'");
                $rs['trade']=$data['name'];
            }


		
		return $rs;
	}

}
