wugg 1 年之前
父节点
当前提交
7ed3866593
共有 2 个文件被更改,包括 20 次插入9 次删除
  1. 5 3
      app/admin/controller/Payment.php
  2. 15 6
      app/command/handleCxData.php

+ 5 - 3
app/admin/controller/Payment.php

@@ -923,22 +923,24 @@ class Payment extends BaseController
          $cgdsource= isset($post['cgdsource']) && $post['cgdsource']!=='' ? intval($post['cgdsource']) :"";
         if($cgdsource!=='') $condition []=["cgdSource","=",$cgdsource];
          $sendstatus= isset($post['sendstatus']) && $post['sendstatus']!='' ? intval($post['sendstatus']) :"";
-        if($sendstatus!='') $condition []=["sendStatus","=",$sendstatus];
+        if($sendstatus!='') $condition []=["qrdSend","=",$sendstatus];
 
         $page =  isset($post['page'])&&$post['page']!="" ? intval($post['page']) :0;
         $size =  isset($post['size'])&&$post['size']!="" ? intval($post['size']) :10;
         $count =  Db::name("cgd_info")->where($condition)->count();
         $total = ceil($count/$size);
         $page = $page>=$total?intval($total):$page;
-        $list =  Db::name("cgd_info")->where($condition)->page($page,$size)->order('createdTime desc')->select()->toArray();
+        $list =  Db::name("cgd_info")
+        ->where($condition)->page($page,$size)->order('createdTime desc')
+        ->select()->toArray();
 
         //校验是否开通了供应商账号
         $supp_account = check_has_account_by_supplierNos(array_unique(array_column($list,'supplierNo')));
-
         foreach ($list as &$value){
         	$value['goodNum'] =$value['goodNum']- $value['thNum'];
         	$value['sendNum'] =$value['sendNum']- $value['thNum'];
             $value['has_account'] = (int)isset($supp_account['data'][$value['supplierNo']]);
+            
         }
         return app_show(0,"获取成功",["list"=>$list,"count"=>$count]);
     }

+ 15 - 6
app/command/handleCxData.php

@@ -159,7 +159,8 @@ class handleCxData extends command
 								          ]
 							          );
 
-						    } else {
+						    }
+						    else {
 							    $wait_insert_data=[
 								    "order_type"=>$result['order_type'] ,
 								    "data"=>json_encode($result['data'] , JSON_UNESCAPED_UNICODE) ,
@@ -197,8 +198,8 @@ class handleCxData extends command
 								          ]
 							          );
 						    }
-
-					    } else {
+					    }
+					    else {
 						    //新增
 						    $qrd_insert_data[]=[
 							    'name'=>$data['orderCode'] ,//确认单名称,
@@ -277,8 +278,10 @@ class handleCxData extends command
 
 						    ];
 					    }
-
-
+						if($data['cgdNo']!=''){
+								Db::name('cgd_info')->where(['sequenceNo'=>$data['cgdNo']])->update(['qrdSend',$data['send_status']]);
+							}
+					
 				    } else {
 					    //已存在
 					    $data['total_fee']=$data['total_fee'] - $data['th_fee'] - $data['diff_fee'];
@@ -298,6 +301,8 @@ class handleCxData extends command
 					    $exists_cgd=Db::name('cgd_info')
 					                  ->whereIn('sequenceNo' , $data['cgdNo'])
 					                  ->field('id,status')->findOrEmpty();
+					    $data['qrdSend'] = Db::name("qrd_info")->where(["cgdNo"=>$data['cgdNo']])->value
+					    ("sendStatus",0);
 					    if (!empty($exists_cgd)) {
 
 						    //未对账,更新
@@ -413,6 +418,7 @@ class handleCxData extends command
 									      'sendType'=>$data['send_type'] ,//发货方式',
 									      'bkCreater'=>$data['bkcreater'] ,//备库申请人',
 									      'sendStatus'=>$data['send_status'] ,//发货状态',
+									      'qrdSend'=>$data['qrdSend'] ,//发货状态',
 									      'wsendNum'=>$data['wsend_num'] ,//未发货数量',
 									      'sendNum'=>$data['send_num'] ,//已发货数量',
 									      'wareHouse'=>$data['wsm_code'] ,//仓库名称',
@@ -424,7 +430,8 @@ class handleCxData extends command
 								      ]
 							      );
 						    }
-					    } else {
+					    }
+					    else {
 						    //新增
 						    $cgd_insert_data[]=[
 							    'name'=>$data['cgdNo'] ,//采购单名称',
@@ -480,6 +487,7 @@ class handleCxData extends command
 							    'sendType'=>$data['send_type'] ,//发货方式',
 							    'bkCreater'=>$data['bkcreater'] ,//备库申请人',
 							    'sendStatus'=>$data['send_status'] ,//发货状态',
+							     'qrdSend'=>$data['qrdSend'] ,
 							    'wsendNum'=>$data['wsend_num'] ,//未发货数量',
 							    'sendNum'=>$data['send_num'] ,//已发货数量',
 							    'wareHouse'=>$data['wsm_code'] ,//仓库名称',
@@ -498,6 +506,7 @@ class handleCxData extends command
 							    'updatetime'=>$date ,
 						    ];
 					    }
+					   
 				    }
 
 				    if ($qrd_insert_data) Db::name('qrd_info')->insertAll($qrd_insert_data);