Ck.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. class Ck extends Start_Controller {
  3. public function __construct(){
  4. parent::__construct();
  5. $this->load->_model('Model_ck','ck');
  6. $this->load->_model('Model_warehouse','warehouse');
  7. $this->load->_model('Model_specialstock','specialstock');
  8. $this->load->_model('Model_whlabel','whlabel');
  9. $this->load->_model('Model_typeclass','typeclass');
  10. $this->load->_model('Model_whlabel_fc','whlabel_fc');
  11. }
  12. //定义方法的调用规则 获取URI第二段值
  13. public function _remap($arg,$arg_array)
  14. {
  15. if($arg == 'kcyz')//添加
  16. {
  17. $this->_kcyz();
  18. }
  19. else
  20. {
  21. $this->_index();
  22. }
  23. }
  24. public function _kcyz()
  25. {
  26. $post = $this->input->post(NULL, TRUE);
  27. if(isset($post['warehouse']))
  28. {
  29. $warehouse = $this->input->post('warehouse',true);
  30. $whlabel = $this->input->post('whlabel',true);
  31. $id = $this->input->post('id',true);
  32. $shop = $this->input->post('shop',true);
  33. $number = $this->input->post('number',true);
  34. $state = $this->input->post('state',true);
  35. $warehouse = $this->warehouse->read($warehouse);
  36. if(!$state)
  37. {
  38. $state = 207;
  39. }
  40. if(!$number)
  41. {
  42. $number = '001';
  43. }
  44. if(!$whlabel || $whlabel == '|')
  45. {
  46. echo json_encode(array('msg'=>'请先添加产品信息!','success'=>false));exit;
  47. }
  48. $z = $this->ck->get_kcyz($state,$warehouse,$shop,$number,$whlabel,'');
  49. if($z['t'] > '0')
  50. {
  51. echo $z['m'];
  52. }
  53. else
  54. {
  55. echo json_encode(array('success'=>true));exit;
  56. }
  57. }
  58. }
  59. }