|
|
@@ -12,6 +12,7 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$this->load->_model("Model_typeclass","typeclass");
|
|
|
$this->load->_model("Model_settingtest","settingtest");
|
|
|
$this->load->_model("Model_apiyyv1","apiyyv1");
|
|
|
+ $this->load->_model("Model_whlabel","whlabel");
|
|
|
}
|
|
|
private $show_url = "https://lyerposs.wepolicy.cn";
|
|
|
public function _remap($arg,$arg_array)
|
|
|
@@ -40,6 +41,8 @@ class Goodimglibrary extends Start_Controller {
|
|
|
$this->_editsku();
|
|
|
}elseif($arg == 'editkuwei'){
|
|
|
$this->_editkuwei();
|
|
|
+ }elseif($arg == 'jmbysku'){
|
|
|
+ $this->_jmbysku();
|
|
|
}else{
|
|
|
$this->_index();
|
|
|
}
|
|
|
@@ -949,4 +952,36 @@ class Goodimglibrary extends Start_Controller {
|
|
|
echo json_encode(['success'=>false,'msg'=>'请求不合法']);exit;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public function _jmbysku(){
|
|
|
+ if($this->input->method() == 'post'){
|
|
|
+ $jm = $this->input->post('jm',true);
|
|
|
+ if(empty($jm)){
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'请求参数异常']);exit;
|
|
|
+ }
|
|
|
+ $info = $this->goods->find('jm = "'.$jm.'"');
|
|
|
+ if(empty($info)){
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'料品不存在']);exit;
|
|
|
+ }
|
|
|
+ $features = $info['features'];
|
|
|
+ $features_arr = explode("-",trim($features,"-"));
|
|
|
+
|
|
|
+ $typeclass_list = $this->typeclass->find_all("id in (".implode(",",$features_arr).")");
|
|
|
+ $features_arr = array_column($typeclass_list,'id','classid');
|
|
|
+ $res = $this->logic_zhlp->sortByColume($features_arr);
|
|
|
+ if($res['code'] != 1){
|
|
|
+ echo json_encode(['success'=>false,'msg'=>$res["msg"]]);exit;
|
|
|
+ }
|
|
|
+ $classid = $this->logic_u9tools->getClass();
|
|
|
+ $r = $this->logic_zhlp->featureTransferColumn($res['data'],$classid);
|
|
|
+ $info = $this->whlabel->find("sku !='".$r['sku']."' and features = '".$features."' and warehouse = 13");
|
|
|
+ if(!empty($info)){
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'系统生成sku和库存使用sku不一致联系技术处理']);exit;
|
|
|
+ }
|
|
|
+ echo json_encode(['success'=>true,'msg' =>$r['sku']]);
|
|
|
+ }else{
|
|
|
+ echo json_encode(['success'=>false,'msg'=>'请求不合法']);exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|