|
@@ -1072,25 +1072,27 @@ class After extends Base
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- $data=[
|
|
|
- "orderCode"=>$info['orderCode'],
|
|
|
- "th_type"=>3,
|
|
|
- "th_num"=>$info['error_num'],
|
|
|
- "th_fee"=>round($sale['sale_price']*$info["error_num"],2),
|
|
|
- "thCode"=>$info['returnCode'],
|
|
|
- "spuCode"=>$sale['good_code'],
|
|
|
- "good_name"=>$sale['good_name'],
|
|
|
- "cat_id"=>$sale['cat_id'],
|
|
|
- "apply_id"=>$info['apply_id'],
|
|
|
- "apply_name"=>$info['apply_name'],
|
|
|
- "addtime"=>date("Y-m-d H:i:s"),
|
|
|
- "status"=>1,
|
|
|
- "is_del"=>0
|
|
|
- ];
|
|
|
- $inse=Db::name("th_data")->insert($data);
|
|
|
- if($inse==false){
|
|
|
- Db::rollback();
|
|
|
- return error_show(1004,"退货单更新失败");
|
|
|
+ if($info['return_tag']==1){
|
|
|
+ $data=[
|
|
|
+ "orderCode"=>$info['orderCode'],
|
|
|
+ "th_type"=>3,
|
|
|
+ "th_num"=>$info['error_num'],
|
|
|
+ "th_fee"=>round($sale['sale_price']*$info["error_num"],2),
|
|
|
+ "thCode"=>$thNo,
|
|
|
+ "spuCode"=>$sale['good_code'],
|
|
|
+ "good_name"=>$sale['good_name'],
|
|
|
+ "cat_id"=>$sale['cat_id'],
|
|
|
+ "apply_id"=>$info['apply_id'],
|
|
|
+ "apply_name"=>$info['apply_name'],
|
|
|
+ "addtime"=>date("Y-m-d H:i:s"),
|
|
|
+ "status"=>1,
|
|
|
+ "is_del"=>0
|
|
|
+ ];
|
|
|
+ $inse=Db::name("th_data")->insert($data);
|
|
|
+ if($inse==false){
|
|
|
+ Db::rollback();
|
|
|
+ return error_show(1004,"退货单更新失败");
|
|
|
+ }
|
|
|
}
|
|
|
Db::commit();
|
|
|
return app_show(0,"退货单新建成功",["thNo"=>$thNo]);
|