Forráskód Böngészése

修改typeclass 添加该用友料号已存在

lvhao 3 napja
szülő
commit
69f30b52b0
1 módosított fájl, 15 hozzáadás és 0 törlés
  1. 15 0
      core/CoreApp/controllers/Typeclass.php

+ 15 - 0
core/CoreApp/controllers/Typeclass.php

@@ -179,6 +179,14 @@ class Typeclass extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'SKU/产品名称有重复!','success'=>false));exit;
 			}
+			$jm = $this->input->post('jm',true);
+			if(!empty($jm)){
+				$jm_num =  $this->typeclass->find_all("jm = '$jm'");
+				if(!empty($jm_num)){
+					echo json_encode(array('msg'=>'该用友料号已存在!','success'=>false));exit;
+				}
+			}
+			
 			$post['class'] = $this->input->post('class',true);
 			$post['classid'] = $this->input->post('classid',true);
 			$classtitle = $this->classid->read($post['classid']);
@@ -244,6 +252,13 @@ class Typeclass extends Start_Controller {
 				    echo json_encode(array('msg'=>'SKU/产品名称有重复!','cs'=>'查询ID '.$cf[0]['id'].' - 修改ID '.$id,'success'=>false));exit;
 				}
 			}
+			$jm = $this->input->post('jm',true);
+			if(!empty($jm)){
+				$jm_num =  $this->typeclass->find_all("jm = '$jm' and id != '$id'");
+				if(!empty($jm_num)){
+					echo json_encode(array('msg'=>'该用友料号已存在!','success'=>false));exit;
+				}
+			}
 			$post['classid'] = $this->input->post('classid',true);
 			$classtitle = $this->classid->read($post['classid']);
 			if($post['classid'] != '999')