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'); } //定义方法的调用规则 获取URI第二段值 public function _remap($arg,$arg_array) { if($arg == 'kcyz')//添加 { $this->_kcyz(); } else { $this->_index(); } } 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; } } } }