|
@@ -2630,7 +2630,10 @@ class Sale extends Base
|
|
|
if($outinfo==false){
|
|
|
return error_show(1004,"发货数据未找到");
|
|
|
}
|
|
|
-
|
|
|
+ $einfo = Db::name('sale')->where(['orderCode' => $outinfo['orderCode'], 'is_del' => 0])->find();
|
|
|
+ if (empty($einfo)) {
|
|
|
+ return error_show(1002, "未找到销售订单数据");
|
|
|
+ }
|
|
|
$post_name = isset($this->post['post_name']) &&$this->post['post_name']!="" ? trim($this->post['post_name']):"";
|
|
|
if($post_name==""){
|
|
|
return error_show(1004,"参数post_name不能为空");
|
|
@@ -2649,8 +2652,7 @@ class Sale extends Base
|
|
|
try{
|
|
|
$up =Db::name("order_out")->save($outinfo);
|
|
|
if($up){
|
|
|
- $stokc =Db::name("good_stock")->where(['spuCode'=>$outinfo['spuCode'],"wsm_code"=>$outinfo['wsm_code'],
|
|
|
- "is_del"=>0])->find();
|
|
|
+ $stokc =Db::name("good_stock")->where(['spuCode'=>$einfo['good_code'],"wsm_code"=>$outinfo['wsm_code'],"is_del"=>0])->find();
|
|
|
if($stokc==false){
|
|
|
Db::rollback();
|
|
|
return error_show(1002, "未找库存到数据");
|