Browse Source

Merge branch 'dev_wf' of wugg/phpstock into version1.5

wufeng 2 years ago
parent
commit
e65e983871

+ 1 - 1
app/admin/controller/Proorder.php

@@ -120,7 +120,7 @@ class Proorder extends Base
                 $value['process_name'] = isset($all_process[$value['order_type']]) ? $all_process[$value['order_type']] : '';
                 $value['order_name'] = $var[$value['order_process']]['order_name'];
                 $value['status_name'] = $var[$value['order_process']]['status_name'];
-                $value['order_process_finally_status_name'] = $var[$value['order_process_finally']]['status_name'];
+                $value['order_process_finally_status_name'] = $var[$value['order_process_finally']]['status_name'] ?? '';
                 $data[] = $value;
             }
             return app_show(0, "获取成功", ['count' => $count, 'list' => $data]);

+ 26 - 3
app/admin/controller/Sale.php

@@ -4423,9 +4423,7 @@ class Sale extends Base
         Db::startTrans();
         try {
 
-            $good_data = [];
-
-            $temp_out_codes = [];
+            $good_data =  $temp_out_codes = $yz_data = [];
 
             foreach ($param['list'] as $value) {
 
@@ -4566,12 +4564,37 @@ class Sale extends Base
 
                 } else throw new Exception($value['outCode'] . '发货失败');
                 Cache::store("redis")->handler()->lPush("SENDOUT",$value['outCode']);
+
+
+                //如果是有赞订单的话,将发货信息推到有赞
+                if($sale_infos[$order_out_infos[$value['outCode']]['orderCode']]['order_source']==5){
+                    $yz_data[]=[
+                        'orderCode'=>$sale_infos[$order_out_infos[$value['outCode']]['orderCode']],
+                        'out_stype'=>isset($value['post_name']) ? $value['post_name'] : '',,
+                        'post_code'=>$value['post_code'],
+                        'uid'=>$createrid,
+                        'uname'=>$creater,
+                        'order_out'=>$value['outCode'],
+                    ];
+                }
             }
 
             if (!empty($good_data)) GoodLog::LogAdd(['id' => $createrid, 'nickname' => $creater], $good_data, "CKD");
 
             Db::commit();
 
+            //如果是有赞订单的话,将发货信息推到有赞
+            //有赞信息有可能推送失败(比如超过72小时,不允许多次修改等),所以不应该和这里的事务放到一起
+            if ($yz_data) {
+                foreach ($yz_data as $yz) {
+//                    $res = curl_request(config('app.yz_domain') . 'api/yz_out_send', ['orderCode' => $einfo['orderCode'], 'out_stype' => $post_name, 'post_code' => $post_code, 'uid' => $uid, 'uname' => $uname, 'order_out' => $outCode]);
+                    curl_request(config('app.yz_domain') . 'api/yz_out_send', $yz);
+                }
+
+//                $res = json_decode($res, true);
+//                if ($res['code'] != 0) return app_show(0, '发货成功,' . $res['message']);
+            }
+
             return app_show(0, '发货成功');
 
         } catch (Exception $exception) {

+ 2 - 2
app/command/UpdateProcessWaitFinallyData.php

@@ -144,11 +144,11 @@ class UpdateProcessWaitFinallyData extends Command
 
             Db::commit();
 
-            $output->writeln('更新成功');
+            $output->writeln('update success');
 
         } catch (Exception $exception) {
             Db::rollback();
-            $output->writeln('更新失败,' . $exception->getMessage());
+            $output->writeln('update fail,' . $exception->getMessage());
         }
 
 

+ 1 - 1
app/youzan/logic/Goodup.php

@@ -170,7 +170,7 @@ class Goodup
                         "order_id" => $create,
                         "order_status" => $tmp['exam_status'],
                         "before_status" => $tmp['exam_status'],
-                        'holder_id'=>$god['chargerid'],
+                        'holder_id' => Db::name('good_basic')->where(["spuCode" => $value['spuCode'], "is_del" => 0])->value('chargerid', 0),
                     ]);
                     $iso = Db::name("good")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->find();
                     if ($iso == false) {