|
@@ -437,9 +437,6 @@ class Purchin extends BaseController
|
|
|
if(empty($return)){
|
|
|
return error_show(1004,"未找到退货单数据");
|
|
|
}
|
|
|
- if($return['status']!=1){
|
|
|
- return error_show(1004,"退货单数据状态有误");
|
|
|
- }
|
|
|
$post_code = isset($this->post['post_code']) &&$this->post['post_code']!=="" ? trim($this->post['post_code']):"" ;
|
|
|
if($post_code==""){
|
|
|
return error_show(1004,"参数 post_code 不能为空");
|
|
@@ -453,14 +450,14 @@ class Purchin extends BaseController
|
|
|
"post_code"=>$post_code,
|
|
|
"post_company"=>$post_company,
|
|
|
"remark"=>$remark,
|
|
|
- "status"=>2,
|
|
|
+ "status"=>1,
|
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
|
];
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
$up =Db::name("purchease_return")->where($return)->save($data);
|
|
|
if($up){
|
|
|
- $info['status']=7;
|
|
|
+ $info['status']=5;
|
|
|
$info['updatetime']=date("Y-m-d H:i:s");
|
|
|
$sa=Db::name("purchease_in")->save($info);
|
|
|
if($sa){
|
|
@@ -480,52 +477,52 @@ class Purchin extends BaseController
|
|
|
|
|
|
}
|
|
|
|
|
|
- public function ReturnStatus(){
|
|
|
- $incode = isset($this->post['wsm_in_code'])&&$this->post['wsm_in_code']!="" ? trim($this->post['wsm_in_code']) :"";
|
|
|
- if($incode==""){
|
|
|
- return error_show(1004,"参数wsm_in_code 不为空");
|
|
|
- }
|
|
|
- $info = Db::name("purchease_in")->where(['wsm_in_code'=>$incode,"is_del"=>0])->find();
|
|
|
- if(empty($info)){
|
|
|
- return error_show(1004,"未找到发货单数据");
|
|
|
- }
|
|
|
- $return = Db::name("purchease_return")->where(['wsm_in_code'=>$incode,"is_del"=>0])->find();
|
|
|
- if(empty($return)){
|
|
|
- return error_show(1004,"未找到数据");
|
|
|
- }
|
|
|
- if($info['status']<4){
|
|
|
- return error_show(1004,"入库单未完成");
|
|
|
- }
|
|
|
- $status = isset($this->post['status'])&&$this->post['status']!="" ?$this->post['status']:"";
|
|
|
- if($status==""){
|
|
|
- return error_show(1004,"参数status 不为空");
|
|
|
- }
|
|
|
- Db::startTrans();
|
|
|
- try{
|
|
|
- $data=[
|
|
|
- "status"=>$status,
|
|
|
- "updatetime"=>date("Y-m-d H:i:s")
|
|
|
- ];
|
|
|
- $up =Db::name("purchease_return")->where($return)->save($data);
|
|
|
- if($up){
|
|
|
- $info['status']=$status==1?5:6;
|
|
|
- $info['updatetime']=date("Y-m-d H:i:s");
|
|
|
- $sa=Db::name("purchease_in")->save($info);
|
|
|
- if($sa){
|
|
|
- Db::commit();
|
|
|
- return app_show(0,"更新成功");
|
|
|
- }else{
|
|
|
- Db::rollback();
|
|
|
- return error_show(1004,"更新失败");
|
|
|
- }
|
|
|
- }else{
|
|
|
- Db::rollback();
|
|
|
- return error_show(1004,"更新失败");
|
|
|
- }
|
|
|
- }catch (\Exception $e){
|
|
|
- Db::rollback();
|
|
|
- return error_show(1004,$e->getMessage());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// public function ReturnStatus(){
|
|
|
+// $incode = isset($this->post['wsm_in_code'])&&$this->post['wsm_in_code']!="" ? trim($this->post['wsm_in_code']) :"";
|
|
|
+// if($incode==""){
|
|
|
+// return error_show(1004,"参数wsm_in_code 不为空");
|
|
|
+// }
|
|
|
+// $info = Db::name("purchease_in")->where(['wsm_in_code'=>$incode,"is_del"=>0])->find();
|
|
|
+// if(empty($info)){
|
|
|
+// return error_show(1004,"未找到发货单数据");
|
|
|
+// }
|
|
|
+// $return = Db::name("purchease_return")->where(['wsm_in_code'=>$incode,"is_del"=>0])->find();
|
|
|
+// if(empty($return)){
|
|
|
+// return error_show(1004,"未找到数据");
|
|
|
+// }
|
|
|
+// if($info['status']<4){
|
|
|
+// return error_show(1004,"入库单未完成");
|
|
|
+// }
|
|
|
+// $status = isset($this->post['status'])&&$this->post['status']!="" ?$this->post['status']:"";
|
|
|
+// if($status==""){
|
|
|
+// return error_show(1004,"参数status 不为空");
|
|
|
+// }
|
|
|
+// Db::startTrans();
|
|
|
+// try{
|
|
|
+// $data=[
|
|
|
+// "status"=>$status,
|
|
|
+// "updatetime"=>date("Y-m-d H:i:s")
|
|
|
+// ];
|
|
|
+// $up =Db::name("purchease_return")->where($return)->save($data);
|
|
|
+// if($up){
|
|
|
+// $info['status']=$status==1?5:6;
|
|
|
+// $info['updatetime']=date("Y-m-d H:i:s");
|
|
|
+// $sa=Db::name("purchease_in")->save($info);
|
|
|
+// if($sa){
|
|
|
+// Db::commit();
|
|
|
+// return app_show(0,"更新成功");
|
|
|
+// }else{
|
|
|
+// Db::rollback();
|
|
|
+// return error_show(1004,"更新失败");
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// Db::rollback();
|
|
|
+// return error_show(1004,"更新失败");
|
|
|
+// }
|
|
|
+// }catch (\Exception $e){
|
|
|
+// Db::rollback();
|
|
|
+// return error_show(1004,$e->getMessage());
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
}
|