更新修改联营sku库存

parent 8d8fe6e6
...@@ -905,11 +905,10 @@ function arrayToCommaStr($data,$col,$type=''){ ...@@ -905,11 +905,10 @@ function arrayToCommaStr($data,$col,$type=''){
} }
} }
/* /*
* /^[1-9]{1}\d{0,9}$/ * 判断是否大于0的正整数
* 判断是否大于0的数字,包括小数
*/ */
function checkIn($str){ function checkIn($str){
if(preg_match("/^[1-9]{1}\d{0,9}$/",$str)) //大于0的数字,包括小数 if(preg_match("/^[1-9]{1}\d{0,9}$/",$str))
{ {
return true; return true;
}else{ }else{
......
...@@ -115,8 +115,8 @@ class ServerFoostoneModel ...@@ -115,8 +115,8 @@ class ServerFoostoneModel
$purchases = $data['purchases'];//梯度价 $purchases = $data['purchases'];//梯度价
//检测梯度 //检测梯度
foreach ($purchases as $k=>$v ){ foreach ($purchases as $k=>$v ){
if (empty($v)) continue; if ($v === "") continue;
if ( !(int)$v) return [1002,'阶梯数量填写不对:'.$v]; if ( !checkIn($v)) return [1002,'阶梯数量填写不对:'.$v];
if ($k>0 && $purchases[$k] <= $purchases[$k-1]) return [1003,'第'.($k+1).'行阶梯数量必须比上一行阶梯数量大']; if ($k>0 && $purchases[$k] <= $purchases[$k-1]) return [1003,'第'.($k+1).'行阶梯数量必须比上一行阶梯数量大'];
if (empty($price_cn[$k]) && empty($price_us[$k]) ) return [1004,'阶梯数量对应国内含税价或香港交货价必填写一个'.$price_cn[$k]]; if (empty($price_cn[$k]) && empty($price_us[$k]) ) return [1004,'阶梯数量对应国内含税价或香港交货价必填写一个'.$price_cn[$k]];
if ($k>0 && $price_cn[$k] != "" && $price_cn[$k] >= $price_cn[$k-1]) return [1005,'第'.($k+1).'行国内含税价必须比上一行国内含税价小']; if ($k>0 && $price_cn[$k] != "" && $price_cn[$k] >= $price_cn[$k-1]) return [1005,'第'.($k+1).'行国内含税价必须比上一行国内含税价小'];
......
...@@ -190,7 +190,7 @@ function pureEditStock(goods_id,stock) { ...@@ -190,7 +190,7 @@ function pureEditStock(goods_id,stock) {
}, },
yes: function(index, layero){ yes: function(index, layero){
//事件 //事件
//layer.close(indxex); layer.close(index);
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment