| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 | 
							- <?php defined('BASEPATH') OR exit('No direct script access allowed');
 
- class Taxzhengzhou extends Start_Controller {
 
- 	public function __construct(){
 
- 		parent::__construct();
 
- 		$this->load->library('session');
 
- 		$this->load->_model('Model_taxzhengzhou','taxzhengzhou');
 
- 		$this->load->_model('Model_taxzhengzhousk','taxzhengzhousk');
 
- 		$this->load->_model('Model_taxzhengzhoush','taxzhengzhoush');
 
- 		$this->load->_model('Model_fullorder','fullorder');
 
- 		$this->load->_model('Model_fullordertt','fullordertt');
 
- 		$this->load->_model('Model_fullordersmt','fullordersmt');
 
- 	}
 
- 	//定义方法的调用规则 获取URI第二段值
 
-     public function _remap($arg,$arg_array)
 
-     {
 
- 		if($arg == 'add')//添加
 
-         {
 
-              $this->_add();
 
-         }
 
- 		else if($arg == 'edit')//修改
 
-         {
 
-              $this->_edit($arg_array);
 
-         }
 
- 		else if($arg == 'skadd')//添加
 
-         {
 
-              $this->_skadd();
 
-         }
 
- 		else if($arg == 'skedit')//修改
 
-         {
 
-              $this->_skedit($arg_array);
 
-         }
 
- 		else if($arg == 'sk')//修改
 
-         {
 
-              $this->_sk($arg_array);
 
-         }
 
- 		else if($arg == 'addsh')//添加
 
-         {
 
-              $this->_addsh($arg_array);
 
-         }
 
- 		else if($arg == 'sh')//添加
 
-         {
 
-              $this->_sh($arg_array);
 
-         }
 
- 		else if($arg == 'shlist')//添加
 
-         {
 
-              $this->_shlist($arg_array);
 
-         }
 
- 		else if($arg == 'wc')//添加
 
-         {
 
-              $this->_wc($arg_array);
 
-         }
 
- 		else if($arg == 'drexcel')//添加
 
-         {
 
-              $this->_drexcel($arg_array);
 
-         }
 
- 		else if($arg == 'ding')//添加
 
-         {
 
-              $this->_ding($arg_array);
 
-         }
 
- 		else
 
- 		{
 
- 			 $this->_index();
 
- 		}
 
-     }
 
- 	//管理
 
- 	public function _index()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['page']))  
 
- 		{
 
- 		    $page = $this->input->post('page',true);
 
- 		    $perpage = $this->input->post('perpage',true);
 
- 			$continent = $this->input->post('continent',true);
 
- 			$express = $this->input->post('express',true);
 
- 			$ename = $this->input->post('ename',true);
 
- 			$zname = $this->input->post('zname',true);
 
- 			$where = "1=1 ";
 
- 			if($continent)
 
-             {
 
-                 $where  .= " and continent = '$continent'";
 
-             }
 
- 			if($express)
 
-             {
 
-                 $where  .= " and express = '$express'";
 
-             }
 
- 			if($ename)
 
-             {
 
-                 $where  .= " and ename = '$ename'";
 
-             }
 
- 			if($zname)
 
-             {
 
-                 $where  .= " and zname = '$zname'";
 
-             }
 
-             //数据排序
 
-             $order_str = "id asc";
 
-             if(empty($page))
 
- 		    {
 
-                 $start = 0;
 
- 		    	$perpage = 1;
 
-             }
 
- 		    else
 
- 		    {
 
-                 $start = ($page - 1)*$perpage;
 
-             }
 
-             //取得信息列表
 
-             $info_list = $this->taxzhengzhou->find_all($where,'id,orderno,apptype,batchnumber,packno,goodsvalue,insuredFee,ht,itemno,iedate,createtime,accountingdate,sh',$order_str,$start,$perpage);
 
- 			foreach ($info_list as $key=>$value) 
 
- 		    {
 
- 				if($value['apptype'] == '1')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '新增';
 
- 				}
 
- 				else if($value['apptype'] == '2')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '变更';
 
- 				}
 
- 				else if($value['apptype'] == '3')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '删除';
 
- 				}
 
- 				if($value['sh'] == '0')
 
- 				{
 
- 					$info_list[$key]['sh'] = '待审核';
 
- 				}
 
- 				else if($value['sh'] == '1')
 
- 				{
 
- 					$info_list[$key]['sh'] = '不通过';
 
- 				}
 
- 				else if($value['sh'] == '2')
 
- 				{
 
- 					$info_list[$key]['sh'] = '通过';
 
- 				}
 
- 				if($value['sh'] != 2)
 
- 				{
 
- 					$info_list[$key]['orderno'] = "<h9 class='windowtwo' data-h='/taxzhengzhou/edit/".$value['id']."' data-t='订单管理' data-h2='/taxzhengzhou/shlist/".$value['id']."' data-t2='审核详情'><p>".$value['orderno']."</p></h9>";
 
- 				}
 
- 				else
 
- 				{
 
- 					$info_list[$key]['orderno'] = "<h9 class='windowtwo' data-h='/taxzhengzhou/wc/".$value['id']."' data-t='订单管理' data-h2='/taxzhengzhou/shlist/".$value['id']."' data-t2='审核详情'><p>".$value['orderno']."</p></h9>";
 
- 				}
 
- 				$info_list[$key]['iedate'] = date('Y-m-d',$value['iedate']);
 
- 				$info_list[$key]['createtime'] = date('Y-m-d h:i:s',$value['createtime']);
 
- 				$info_list[$key]['accountingdate'] = date('Y-m-d h:i:s',$value['accountingdate']);
 
-             }
 
- 		    $total = $this->taxzhengzhou->find_count($where);
 
- 		    $pagenum = ceil($total/$perpage);
 
- 		    $over = $total-($start+$perpage);
 
- 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
 
- 		    echo json_encode($rows);exit;
 
- 		}
 
- 		$this->_Template('tax_zhengzhou',$this->data);
 
- 	}
 
- 	//添加
 
- 	public function _add()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['apptype']))
 
- 		{
 
- 			$createtime = $this->input->post('createtime',true);
 
- 			$post['createtime'] = strtotime($createtime);
 
- 			
 
- 			$iedate = $this->input->post('iedate',true);
 
- 			$post['iedate'] = strtotime($iedate);
 
- 			
 
- 			$accountingdate = $this->input->post('accountingdate',true);
 
- 			$post['accountingdate'] = strtotime($accountingdate);
 
- 			
 
- 			if($this->taxzhengzhou->insert($post))
 
-         	{
 
-          		echo json_encode(array('msg'=>'添加成功','success'=>true));exit;
 
-        	 	}
 
-        		else
 
-         	{
 
-            		echo json_encode(array('msg'=>'添加失败,请重试','success'=>false));exit;
 
-         	}
 
- 		}
 
- 		$this->_Template('tax_zhengzhou_add',$this->data);
 
- 	}
 
- 	//修改
 
- 	public function _edit($arg_array)
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['id']))
 
- 		{
 
- 			$id = $this->input->post('id',true);
 
- 			$post['sh'] = 0;
 
- 			$createtime = $this->input->post('createtime',true);
 
- 			$post['createtime'] = strtotime($createtime);
 
- 			
 
- 			$iedate = $this->input->post('iedate',true);
 
- 			$post['iedate'] = strtotime($iedate);
 
- 			
 
- 			$accountingdate = $this->input->post('accountingdate',true);
 
- 			$post['accountingdate'] = strtotime($accountingdate);
 
- 			
 
- 			if($this->taxzhengzhou->save($post,$id))
 
-         	{
 
-          		echo json_encode(array('msg'=>'修改成功','success'=>true));exit;
 
-        	 	}
 
-        		else
 
-         	{
 
-            		echo json_encode(array('msg'=>'修改失败,请重试','success'=>false));exit;
 
-         	}
 
- 		}
 
- 		$arg_array = $arg_array[0];
 
- 		$taxzhengzhou = $this->taxzhengzhou->read($arg_array);
 
- 		$this->data['taxzhengzhou'] = $taxzhengzhou;
 
- 		$this->_Template('tax_zhengzhou_edit',$this->data);
 
- 	}
 
- 	
 
- 	public function _sk()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['page']))  
 
- 		{
 
- 		    $page = $this->input->post('page',true);
 
- 		    $perpage = $this->input->post('perpage',true);
 
- 			$continent = $this->input->post('continent',true);
 
- 			$express = $this->input->post('express',true);
 
- 			$ename = $this->input->post('ename',true);
 
- 			$zname = $this->input->post('zname',true);
 
- 			$where = "1=1 ";
 
- 			if($continent)
 
-             {
 
-                 $where  .= " and continent = '$continent'";
 
-             }
 
- 			if($express)
 
-             {
 
-                 $where  .= " and express = '$express'";
 
-             }
 
- 			if($ename)
 
-             {
 
-                 $where  .= " and ename = '$ename'";
 
-             }
 
- 			if($zname)
 
-             {
 
-                 $where  .= " and zname = '$zname'";
 
-             }
 
-             //数据排序
 
-             $order_str = "id asc";
 
-             if(empty($page))
 
- 		    {
 
-                 $start = 0;
 
- 		    	$perpage = 1;
 
-             }
 
- 		    else
 
- 		    {
 
-                 $start = ($page - 1)*$perpage;
 
-             }
 
-             //取得信息列表
 
-             $info_list = $this->taxzhengzhousk->find_all($where,'id,orderno,charge,accountingdate',$order_str,$start,$perpage);
 
- 			foreach ($info_list as $key=>$value) 
 
- 		    {
 
- 				$info_list[$key]['accountingdate'] = date('Y-m-d h:i:s',$value['accountingdate']);
 
-             }
 
- 		    $total = $this->taxzhengzhousk->find_count($where);
 
- 		    $pagenum = ceil($total/$perpage);
 
- 		    $over = $total-($start+$perpage);
 
- 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
 
- 		    echo json_encode($rows);exit;
 
- 		}
 
- 		$this->_Template('tax_zhengzhou_sk',$this->data);
 
- 	}
 
- 	//添加
 
- 	public function _skadd()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['apptype']))
 
- 		{
 
- 			$createtime = $this->input->post('createtime',true);
 
- 			$post['createtime'] = strtotime($createtime);
 
- 			
 
- 			$accountingdate = $this->input->post('accountingdate',true);
 
- 			$post['accountingdate'] = strtotime($accountingdate);
 
- 			if($this->taxzhengzhousk->insert($post))
 
-         	{
 
-          		echo json_encode(array('msg'=>'添加成功','success'=>true));exit;
 
-        	 	}
 
-        		else
 
-         	{
 
-            		echo json_encode(array('msg'=>'添加失败,请重试','success'=>false));exit;
 
-         	}
 
- 		}
 
- 		$this->_Template('tax_zhengzhou_sk_add',$this->data);
 
- 	}
 
- 	//修改
 
- 	public function _skedit($arg_array)
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['id']))
 
- 		{
 
- 			$id = $this->input->post('id',true);
 
- 			$createtime = $this->input->post('createtime',true);
 
- 			$post['createtime'] = strtotime($createtime);
 
- 			
 
- 			$accountingdate = $this->input->post('accountingdate',true);
 
- 			$post['accountingdate'] = strtotime($accountingdate);
 
- 			if($this->taxzhengzhousk->save($post,$id))
 
-         	{
 
-          		echo json_encode(array('msg'=>'修改成功','success'=>true));exit;
 
-        	 	}
 
-        		else
 
-         	{
 
-            		echo json_encode(array('msg'=>'修改失败,请重试','success'=>false));exit;
 
-         	}
 
- 		}
 
- 		$arg_array = $arg_array[0];
 
- 		$taxzhengzhousk = $this->taxzhengzhousk->read($arg_array);
 
- 		$this->data['taxzhengzhousk'] = $taxzhengzhousk;
 
- 		$this->_Template('tax_zhengzhou_sk_edit',$this->data);
 
- 	}
 
- 	
 
- 	public function _addsh($arg_array)
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['uid']))
 
- 		{
 
- 			$this->db->trans_begin();
 
- 			$id = $this->input->post('uid',true);
 
- 			$this->taxzhengzhou->save(array('sh'=>$post['sh']),$id);
 
- 			$post['time'] = time();
 
- 			$this->taxzhengzhoush->insert($post);
 
- 			if ($this->db->trans_status() === TRUE)
 
-         	{
 
- 				$this->db->trans_commit();
 
- 				echo json_encode(array('msg'=>'提交成功','success'=>true));exit;
 
- 			}
 
- 			else
 
- 			{
 
- 				$this->db->trans_rollback();
 
- 				echo json_encode(array('msg'=>'提交失败,请重试','success'=>false));exit;
 
- 			}
 
- 		}
 
- 		$arg_array = $arg_array[0];
 
- 		$taxzhengzhou = $this->taxzhengzhou->read($arg_array);
 
- 		$this->data['taxzhengzhou'] = $taxzhengzhou;
 
- 		$this->_Template('tax_zhengzhou_addsh',$this->data);
 
- 	}
 
- 	
 
- 	public function _wc($arg_array)
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		$arg_array = $arg_array[0];
 
- 		$taxzhengzhou = $this->taxzhengzhou->read($arg_array);
 
- 		$this->data['taxzhengzhou'] = $taxzhengzhou;
 
- 		$this->_Template('tax_zhengzhou_wc',$this->data);
 
- 	}
 
- 	
 
- 	public function _sh($arg_array)
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['page']))  
 
- 		{
 
- 		    $page = $this->input->post('page',true);
 
- 		    $perpage = $this->input->post('perpage',true);
 
- 			$continent = $this->input->post('continent',true);
 
- 			$express = $this->input->post('express',true);
 
- 			$ename = $this->input->post('ename',true);
 
- 			$zname = $this->input->post('zname',true);
 
- 			$where = "sh=0 ";
 
- 			if($continent)
 
-             {
 
-                 $where  .= " and continent = '$continent'";
 
-             }
 
- 			if($express)
 
-             {
 
-                 $where  .= " and express = '$express'";
 
-             }
 
- 			if($ename)
 
-             {
 
-                 $where  .= " and ename = '$ename'";
 
-             }
 
- 			if($zname)
 
-             {
 
-                 $where  .= " and zname = '$zname'";
 
-             }
 
-             //数据排序
 
-             $order_str = "id asc";
 
-             if(empty($page))
 
- 		    {
 
-                 $start = 0;
 
- 		    	$perpage = 1;
 
-             }
 
- 		    else
 
- 		    {
 
-                 $start = ($page - 1)*$perpage;
 
-             }
 
-             //取得信息列表
 
-             $info_list = $this->taxzhengzhou->find_all($where,'id,orderno,apptype,batchnumber,packno,goodsvalue,insuredFee,payno,itemno,iedate,createtime,accountingdate',$order_str,$start,$perpage);
 
- 			foreach ($info_list as $key=>$value) 
 
- 		    {
 
- 				if($value['apptype'] == '1')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '新增';
 
- 				}
 
- 				else if($value['apptype'] == '2')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '变更';
 
- 				}
 
- 				else if($value['apptype'] == '3')
 
- 				{
 
- 					$info_list[$key]['apptype'] = '删除';
 
- 				}
 
- 				$info_list[$key]['iedate'] = date('Y-m-d',$value['iedate']);
 
- 				$info_list[$key]['createtime'] = date('Y-m-d h:i:s',$value['createtime']);
 
- 				$info_list[$key]['accountingdate'] = date('Y-m-d h:i:s',$value['accountingdate']);
 
-             }
 
- 		    $total = $this->taxzhengzhou->find_count($where);
 
- 		    $pagenum = ceil($total/$perpage);
 
- 		    $over = $total-($start+$perpage);
 
- 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
 
- 		    echo json_encode($rows);exit;
 
- 		}
 
- 		$this->_Template('tax_zhengzhou_sh',$this->data);
 
- 	}
 
- 	
 
- 	public function _shlist($arg_array)
 
- 	{
 
- 		$where = "uid = '".$arg_array[0]."'";
 
- 		$info_list = $this->taxzhengzhoush->find_all($where,'title,shname,time,sh','id desc');
 
- 		foreach ($info_list as $key=>$value) 
 
- 		{
 
- 			if($value['sh'] == 2)
 
- 			{
 
- 				$info_list[$key]['title'] = '审核通过';
 
- 			}
 
- 			$info_list[$key]['time'] = date('Y-m-d h:i',$value['time']);
 
- 		}
 
- 		$this->data['data'] = $info_list;
 
- 		$this->_Template('tax_zhengzhou_shlist',$this->data);
 
- 	}
 
- 	
 
- 	public function _drexcel($arg_array)
 
- 	{
 
- 		$dir = '/data/excel/'.date('Ymd',time()).'/';
 
- 		$config['upload_path'] = '.'.$dir ;
 
- 		$config['file_name'] = date('Ymd_His_',time()).rand(1000,9999);
 
-         $config['allowed_types'] = 'xls|xlsx|csv';
 
-         $config['max_size'] = 10240;
 
- 		$this->load->library('upload', $config);
 
- 		$this->upload->initialize($config);
 
-         if ($this->upload->do_upload('userfile'))
 
-         {
 
- 			$full_path = $dir.$this->upload->data('file_name');
 
- 			$fileName = '.' . $full_path;
 
-             if (!file_exists($fileName)) 
 
- 			{
 
- 				echo json_encode(array('msg'=>"上传失败,请重试",'success'=>false));exit;
 
-             }
 
- 			else
 
- 			{
 
- 				libxml_use_internal_errors(true);
 
- 				require_once "./data/excel/PHPExcel/IOFactory.php";
 
- 				$phpExcel = PHPExcel_IOFactory::load($fileName);// 载入当前文件
 
- 				$phpExcel->setActiveSheetIndex(0);// 设置为默认表
 
- 				$sheetCount = $phpExcel->getSheetCount();// 获取表格数量
 
- 				$row = $phpExcel->getActiveSheet()->getHighestRow();// 获取行数
 
- 				$column = $phpExcel->getActiveSheet()->getHighestColumn();// 获取列数
 
- 				++$column;//如果列数大于26行
 
- 				$list = array();
 
- 				for ($i = 2; $i <= $row; $i++) // 行数循环
 
- 				{
 
- 					$data = array();
 
-                     for ($c = 'A'; $c != $column; $c++)  // 列数循环
 
- 	                {
 
- 						$data[] = $phpExcel->getActiveSheet()->getCell($c . $i)->getValue();
 
-                     }
 
- 					$list[] = $data;
 
-                 }
 
- 			}
 
- 			$i = 0;$j = 0;$ed = array();$dn = '';$ds = 'get_number';
 
- 		    foreach ($list as $key=>$value)
 
- 		    {
 
- 				if($value[0] == '')
 
- 				{
 
- 					continue;
 
- 				}
 
- 				if($value[0] == '订单号')
 
- 				{
 
- 				    $dn = 0;
 
- 					$ds = 'get_orderinfo';
 
- 					continue;
 
- 				}
 
- 				else if ($value[0] == '序号')
 
- 				{
 
- 					$dn = 19;
 
- 					continue;
 
- 				}
 
- 				else
 
- 				{
 
- 					$dlz = $this->fullorder->$ds($value[0]);
 
- 					$smt = $this->fullordersmt->$ds($value[0]);
 
- 					$dlz2 = $this->fullorder->$ds($value[9]);
 
- 					$smt2 = $this->fullordersmt->$ds($value[9]);
 
- 					if($dlz || $smt)
 
- 					{
 
- 						$dn = 0;
 
- 					}
 
- 					if($dlz2 || $smt2)
 
- 					{
 
- 						$dn = 9;
 
- 					}
 
- 				}
 
- 				$dgs = 'fullorder';
 
- 				$dd = $this->fullorder->$ds($value[$dn]);
 
- 				if(!$dd)
 
- 				{
 
- 					$dd = $this->fullordersmt->$ds($value[$dn]);
 
- 					$dgs = 'fullordersmt';
 
- 				}
 
- 				if(!$dd)
 
- 				{
 
- 					$ed[] = $value[$dn];
 
- 					$j++;
 
- 				}
 
- 				else
 
- 				{
 
- 					$this->$dgs->save(array('gw'=>$arg_array[0]),$dd['id']);
 
- 					$i++;
 
- 				}
 
- 			}
 
- 			if($j > 0)
 
- 			{
 
- 				$tt = date('Ymd',time());
 
- 				$title = '无法识别信息-'.$tt;
 
-         		$titlename = "<table border=1><tr><td>错误详情</td></tr></table>";
 
- 				$tail = "\n";
 
-         		$filename = $title.".xls";
 
-         		$ecl = $this->excel->get_fz3($ed,$titlename,$filename,$tail);
 
- 				$dir = '/data/excel/'.$time.'/';
 
- 				$file_name = 'error_'.$time.rand(1000,9999);
 
- 				if(!is_dir('.'.$dir))mkdir('.'.$dir,0777);
 
- 				$myfile = fopen(".".$dir.$file_name.".xls", "w") or die();
 
- 				fwrite($myfile,$ecl);
 
- 				fclose($myfile);
 
- 				$error = $dir.$file_name.'.xls';
 
- 				echo json_encode(array('msg'=>'导入成功,'.$j.'条异常,','error'=>$error,'success'=>true));exit;
 
- 			}
 
- 			else
 
- 			{
 
- 				echo json_encode(array('msg'=>'导入成功!共导入'.$i.'条','error'=>1,'success'=>true));exit;
 
- 			}
 
- 		}
 
- 	}
 
- 	
 
- 	public function _ding()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($_SESSION['api']))
 
- 		{
 
- 			$user = $this->user->get_api($_SESSION['api']);
 
- 			$usp = $user;
 
- 		    $fgshop = "";$sid = "";$wid="";$wtype="";
 
- 		    $usersp = explode('|',trim($user['shop'],'|'));
 
- 			$userwh = explode('|',trim($user['warehouse'],'|'));
 
- 			foreach ($usersp as $value) 
 
- 		    {
 
- 				$fgshop .= " shop = ".$value." or";
 
- 				$sid .= " id = ".$value." or";
 
- 			}
 
- 			foreach ($userwh as $value) 
 
- 		    {
 
- 				$wid .= " id = ".$value." or";
 
- 				$wtype .= " type = ".$value." or";
 
- 			}
 
- 		}
 
- 		if(isset($post['page']))  
 
- 		{
 
- 		    $page = $this->input->post('page',true);
 
- 		    $perpage = $this->input->post('perpage',true);
 
- 			$ht = $this->input->post('ht',true);
 
- 			$orderno = $this->input->post('orderno',true);
 
- 			$timetk = $this->input->post('timetk',true);
 
- 			$timetj = $this->input->post('timetj',true);
 
- 			$timetk = strtotime($timetk);
 
- 			$timetj = strtotime($timetj);
 
- 			$where = "gw != 0 and dtime > '$timetk' and dtime < '$timetj'";;
 
- 			if($ht)
 
-             {
 
- 				$tax = $this->taxzhengzhou->get_ht($ht);
 
-                 $where  .= " and gw = '".$tax['id']."'";
 
-             }
 
- 			if($orderno)
 
-             {
 
- 				$tax = $this->taxzhengzhou->get_orderno($orderno);
 
-                 $where  .= " and gw = '".$tax['id']."'";
 
-             }
 
-             //数据排序
 
-             $order_str = "dtime desc";
 
-             if(empty($page))
 
- 		    {
 
-                 $start = 0;
 
- 		    	$perpage = 1;
 
-             }
 
- 		    else
 
- 		    {
 
-                 $start = ($page - 1)*$perpage;
 
-             }
 
- 			$info_list = array();
 
- 			$info_listsmt = array();
 
- 			$dlz = 0; $smt = 0;
 
-             //取得信息列表
 
-             $info_list = $this->fullorder->find_all($where,'id,orderinfo,number,name,dtime,waybill',$order_str,$start,$perpage);
 
- 			 //格式化数据
 
-             foreach ($info_list as $key=>$value) 
 
- 		    {
 
- 				$info_list[$key]['dtime'] = date('Y-m-d H:i:s',$value['dtime']);
 
- 				$info_list[$key]['orderinfo'] = "<h9 class='window' data-h='/finance/product/dlz/".$value['id']."' data-t='订单号:".$value['orderinfo']."'><p>".$value['orderinfo']."</p></h9>";
 
-             }
 
- 			    $dlz += $this->fullorder->find_count($where);
 
- 			$info_listsmt = $this->fullordersmt->find_all($where,'id,orderinfo,number,name,dtime,waybill',$order_str,$start,$perpage);
 
- 			 //格式化数据
 
-             foreach ($info_listsmt as $key=>$value) 
 
- 		    {
 
- 				$info_listsmt[$key]['dtime'] = date('Y-m-d H:i:s',$value['dtime']);
 
- 				$info_listsmt[$key]['orderinfo'] = "<h9 class='window' data-h='/finance/product/smt/".$value['id']."' data-t='订单号:".$value['orderinfo']."'><p>".$value['orderinfo']."</p></h9>";
 
-             }
 
- 			    $smt += $this->fullordersmt->find_count($where);
 
- 			//$total += $this->fullorder_smt->find_count($where);
 
- 			$total = $dlz+$smt;
 
- 			$rows = array_merge($info_list,$info_listsmt);
 
- 			//$rows = array_slice($rows,$start,$perpage);
 
- 		    $pagenum = ceil($total/$perpage);
 
- 		    $over = $total-($start+$perpage);
 
- 			$tmp = array();
 
- 			foreach ($rows as $key => $val)
 
- 			{
 
-                 $tmp[$key] = $val['dtime'];
 
-             }
 
-             array_multisort($tmp,SORT_DESC,$rows);
 
- 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($rows),'cs'=>$where);//array_merge($info_list,$info_list_smt,$info_listsmt)
 
- 		    echo json_encode($rows);exit;
 
- 		}
 
- 		$this->_Template('tax_zhengzhou_ding',$this->data);
 
- 	}
 
- 	
 
- 	public function _ck()
 
- 	{
 
- 		
 
- 	}
 
- }
 
 
  |