|
@@ -29,7 +29,11 @@ class Reorder extends Base
|
|
|
if(empty($order)){
|
|
|
return error_show(1005,"未找到订单数据");
|
|
|
}
|
|
|
-
|
|
|
+ $retrun =Db::name("sale_return")->where([["order_code","=",$ordeCode],["is_del","=",0],["status","<",4]])
|
|
|
+ ->count();
|
|
|
+ if($retrun>0){
|
|
|
+ return error_show(1005,"存在未完成退货订单数据");
|
|
|
+ }
|
|
|
if($order['order_type']==3|| $order['order_type']==4){
|
|
|
$goon = Db::name("good_zixun")->where(["spuCode"=>$order['good_code'],"is_del"=>0])->find();
|
|
|
}else {
|
|
@@ -800,7 +804,7 @@ class Reorder extends Base
|
|
|
return error_show(1005, '未找到关联采购单');
|
|
|
}
|
|
|
$ordernum['send_num'] -= $info['num'];
|
|
|
- $ordernum['wsend_num'] = $info['return_num'];
|
|
|
+ $ordernum['wsend_num'] = $info['num'];
|
|
|
$orderup = Db::name("order_num")->save($ordernum);
|
|
|
if ($orderup == false) {
|
|
|
Db::rollback();
|