|
@@ -29,6 +29,11 @@ class After extends Base
|
|
|
$after_num =Db::name("order_return")->where(["orderCode"=>$orderout['orderCode'],"outCode"=>$outCode])
|
|
|
->where("status","not in",[5,8])->sum("error_num");
|
|
|
|
|
|
+ $th_num =Db::name("order_back")->where(["orderCode"=>$orderout['orderCode'],"outCode"=>$outCode,"is_del"=>0])
|
|
|
+ ->where("status","<>",4)->sum("return_num");
|
|
|
+ if($th_num!=0 || $after_num!=0){
|
|
|
+ return error_show(1005,"存在售后或售后退货未结束流程");
|
|
|
+ }
|
|
|
$wsm =Db::name("warehouse_info")->where(["wsm_code"=>$orderout['wsm_code']])->find();
|
|
|
if($wsm==false){
|
|
|
return error_show(1005,"未找到仓库数据");
|
|
@@ -59,7 +64,9 @@ class After extends Base
|
|
|
return error_show(1004,"参数 num 不能为空或零");
|
|
|
}
|
|
|
}
|
|
|
- if($num>$orderout['send_num']-$after_num){
|
|
|
+ $thnum =Db::name("order_back")->where(["orderCode"=>$orderout['orderCode'],"outCode"=>$outCode,"is_del"=>0])
|
|
|
+ ->where("status","=",4)->sum("return_num");
|
|
|
+ if($num>$orderout['send_num']-$thnum){
|
|
|
return error_show(1004,"可用售后数量不足");
|
|
|
}
|
|
|
$except_code =isset($this->post['except_code']) &&$this->post['except_code']!=''?trim($this->post['except_code']) :"";
|