lvhao пре 7 часа
родитељ
комит
9c60895190
1 измењених фајлова са 45 додато и 45 уклоњено
  1. 45 45
      core/CoreApp/controllers/Specialstock.php

+ 45 - 45
core/CoreApp/controllers/Specialstock.php

@@ -366,51 +366,51 @@ class Specialstock extends Start_Controller {
 			$whlabel = explode('|',trim($whlabel,'|'));
 			$i = 0;$list = array();$a=array();
 			//更具要求特殊仓库存不在有限匹配
-			// foreach ($data as $v)
-			// {
-			// 	$v = str_replace(array('-163-','-164-','-165-','-166-'),'-',$v);
-			// 	$vfl = explode('-',trim($v,'-'));
-			// 	$num = explode('-',trim($whlabel[$i],'-'));
-			// 	if(isset($vfl[4]))
-			// 	{
-			// 		if($vfl[4] == 149)//如果是360头套 那么也可以匹配370头套
-			// 		{
-			// 			$pp = $this->specialstock->find_all("featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' and zd = '' and state = '0'");
-			// 			if(!$pp)
-			// 			{
-			// 				$pp = $this->specialstock->find_all("(featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' or featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3]."-329') and zd = '' and state = '0'");
-			// 			}
-			// 		}
-			// 		else
-			// 		{
-			// 	        $pp = $this->specialstock->find_all("featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' and zd = '' and state = '0'");
-			// 		}
-			// 		$yzd='';
-			// 		if(isset($num[2]))
-			// 		{
-			// 		    preg_match_all('/\d+/',$num[2],$n);
-			// 			$n = join('',$n[0]);
-			// 		    $yzd = $this->specialstock->find_all("id = '$n' and zd = '$number'");
-			// 		}
-			// 	    if(count($pp) >= $num[1] && !$yzd)
-			// 	    {
-			// 			$w = '特殊';//有现货仓的设置后面特殊更改为现货
-			// 		    $list[] = array($i,$pp[0]['id'],$w);
-			// 	    }
-			// 		else if($yzd)
-			// 		{
-			// 			foreach ($yzd as $val)
-			//             {
-			// 				if($num[2] == $val['id'].'z')
-			// 				{
-			// 					$w = '特殊';//有现货仓的设置后面特殊更改为现货
-			// 					$list[] = array($i,$yzd[0]['id'],$w);
-			// 				}
-			// 			}
-			// 		}
-			// 	}
-			// 	$i++;
-			// }
+			foreach ($data as $v)
+			{
+				$v = str_replace(array('-163-','-164-','-165-','-166-'),'-',$v);
+				$vfl = explode('-',trim($v,'-'));
+				$num = explode('-',trim($whlabel[$i],'-'));
+				if(isset($vfl[4]))
+				{
+					if($vfl[4] == 149)//如果是360头套 那么也可以匹配370头套
+					{
+						$pp = $this->specialstock->find_all("featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' and zd = '' and state = '0'");
+						if(!$pp)
+						{
+							$pp = $this->specialstock->find_all("(featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' or featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3]."-329') and zd = '' and state = '0'");
+						}
+					}
+					else
+					{
+				        $pp = $this->specialstock->find_all("featurespp = '".$vfl[0].'-'.$vfl[2].'-'.$vfl[3].'-'.$vfl[4]."' and zd = '' and state = '0'");
+					}
+					$yzd='';
+					if(isset($num[2]))
+					{
+					    preg_match_all('/\d+/',$num[2],$n);
+						$n = join('',$n[0]);
+					    $yzd = $this->specialstock->find_all("id = '$n' and zd = '$number'");
+					}
+				    if(count($pp) >= $num[1] && !$yzd)
+				    {
+						$w = '特殊';//有现货仓的设置后面特殊更改为现货
+					    $list[] = array($i,$pp[0]['id'],$w);
+				    }
+					else if($yzd)
+					{
+						foreach ($yzd as $val)
+			            {
+							if($num[2] == $val['id'].'z')
+							{
+								$w = '特殊';//有现货仓的设置后面特殊更改为现货
+								$list[] = array($i,$yzd[0]['id'],$w);
+							}
+						}
+					}
+				}
+				$i++;
+			}
 			if($list)
 			{
 				echo json_encode(array('list'=>$list,'success'=>true));exit;