| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | 
							- <?php defined('BASEPATH') OR exit('No direct script access allowed');
 
- class Ck extends Start_Controller {
 
- 	public function __construct(){
 
- 		parent::__construct();
 
- 		$this->load->_model('Model_ck','ck');
 
- 		$this->load->_model('Model_warehouse','warehouse');
 
- 		$this->load->_model('Model_specialstock','specialstock');
 
- 		$this->load->_model('Model_whlabel','whlabel');
 
- 		$this->load->_model('Model_typeclass','typeclass');
 
- 		$this->load->_model('Model_whlabel_fc','whlabel_fc');
 
- 		$this->load->_model("Model_logic_goods_replace","logic_goods_replace");
 
- 		$this->load->_model("Model_logic_tools","logic_tools");
 
- 	}
 
- 	//定义方法的调用规则 获取URI第二段值
 
-     public function _remap($arg,$arg_array)
 
-     {
 
- 		if($arg == 'kcyz')//添加
 
-         {
 
-              $this->_kcyz();
 
-         }
 
- 		elseif($arg == 'mcth'){
 
- 			$this->_mcth();
 
- 		}
 
- 		else
 
- 		{
 
- 			 $this->_index();
 
- 		}
 
-     }
 
- 	private function _index(){
 
- 		exit('No direct script access allowed');
 
- 	}
 
- 	private function _mcth(){
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(empty($post['number'])){
 
- 			exit($this->logic_tools->ret_json(-1,'订单编码不能为空'));
 
- 		}
 
- 		if(empty($post['fpdata'])){
 
- 			exit($this->logic_tools->ret_json(-1,'订单产品信息为传递'));
 
- 		}
 
- 		$res = $this->logic_goods_replace->do_replace($post['number'],$post['fpdata']);
 
- 		exit(json_encode($res));
 
- 	}
 
- 	public function _kcyz()
 
- 	{
 
- 		$post = $this->input->post(NULL, TRUE);
 
- 		if(isset($post['warehouse']))  
 
- 		{
 
- 			$warehouse = $this->input->post('warehouse',true);
 
- 		    $whlabel = $this->input->post('whlabel',true);
 
- 			$id = $this->input->post('id',true);
 
- 			$shop = $this->input->post('shop',true);
 
- 			$number = $this->input->post('number',true);
 
- 			$state = $this->input->post('state',true);
 
- 			$warehouse = $this->warehouse->read($warehouse);
 
- 			if(!$state)
 
- 			{
 
- 				$state = 207;
 
- 			}
 
- 			if(!$number)
 
- 			{
 
- 				$number = '001';
 
- 			}
 
- 			if(!$whlabel || $whlabel == '|')
 
- 			{
 
- 				echo json_encode(array('msg'=>'请先添加产品信息!','success'=>false));exit;
 
- 			}
 
- 			$z = $this->ck->get_kcyz($state,$warehouse,$shop,$number,$whlabel,'');
 
- 			if($z['t'] > '0')
 
- 			{
 
- 				echo $z['m'];
 
- 			}
 
- 			else
 
- 			{
 
- 				echo json_encode(array('success'=>true));exit;
 
- 			}
 
- 		}
 
- 	}
 
- }
 
 
  |