|
@@ -141,15 +141,14 @@ class Model_ck extends Lin_Model
|
|
$wh = $this->whlabel->find_count("state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and (shop IS NULL or shop = '')");//通用
|
|
$wh = $this->whlabel->find_count("state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and (shop IS NULL or shop = '')");//通用
|
|
$shopwh = $this->whlabel->find_count("state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and shop like '%,".$shop.",%'");//专属
|
|
$shopwh = $this->whlabel->find_count("state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and shop like '%,".$shop.",%'");//专属
|
|
$x++;
|
|
$x++;
|
|
- //$this->logic_ding->sendToDing("库存验证数据2【".$number."】".json_encode($num)."库存数量:".($wh+$shopwh)."仓库的占单模式".$warehouse['zdms']."$".json_encode($save));
|
|
|
|
|
|
+
|
|
if($wh+$shopwh < $num[1] || (isset($num[2]) && $num[2] == "DNOTO" && $warehouse['zdms'] == 2))
|
|
if($wh+$shopwh < $num[1] || (isset($num[2]) && $num[2] == "DNOTO" && $warehouse['zdms'] == 2))
|
|
{
|
|
{
|
|
- // $this->logic_ding->sendToDing("库存验证数据【".$number."】".json_encode($num)."库存数量:".($wh+$shopwh)."仓库的占单模式".$warehouse['zdms']);
|
|
|
|
- // $this->logic_ding->sendToDing("库存验证数据【".$number."】"."state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and (shop IS NULL or shop = '')");
|
|
|
|
|
|
+ //$this->logic_ding->sendToDing("库存验证数据【".$number."】".json_encode($num)."库存数量:".($wh+$shopwh)."仓库的占单模式".$warehouse['zdms']);
|
|
$save[] = $x-1;continue;//提前先加X不然出错,所以要减1
|
|
$save[] = $x-1;continue;//提前先加X不然出错,所以要减1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //$this->logic_ding->sendToDing("库存验证数据2【".$number."】".json_encode($num)."库存数量:".($wh+$shopwh)."仓库的占单模式".$warehouse['zdms']."$".json_encode($save));
|
|
if(isset($save[0]) && $warehouse['zdms'] == 2)
|
|
if(isset($save[0]) && $warehouse['zdms'] == 2)
|
|
{
|
|
{
|
|
return array('t'=>1,'m'=>json_encode(array('t'=>2,'msg'=>"红色商品名库存不够扣减或不允许占单",'error'=>$save,'hq'=>"state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and (shop IS NULL or shop = '')",'success'=>false)));exit;
|
|
return array('t'=>1,'m'=>json_encode(array('t'=>2,'msg'=>"红色商品名库存不够扣减或不允许占单",'error'=>$save,'hq'=>"state = '0' and number = '$num[0]' and warehouse = '".$warehouse['id']."' and (zd = '$number' or zd = '') and (shop IS NULL or shop = '')",'success'=>false)));exit;
|