Browse Source

Merge branch 'wugg-dev' of wugg/phpstock into version1.5

wugg 2 years ago
parent
commit
5769b3e4da
1 changed files with 9 additions and 5 deletions
  1. 9 5
      app/command/ImportOrderFromCHandleData.php

+ 9 - 5
app/command/ImportOrderFromCHandleData.php

@@ -409,15 +409,19 @@ class ImportOrderFromCHandleData extends Command
                                     "addtime" => date("Y-m-d H:i:s"),
                                     "updatetime" => date("Y-m-d H:i:s")
                                 ];
-                                $ou = Db::name("order_out")->insert($out);
+                                $ou = Db::name("order_out")->insertGetId($out);
                                 if ($ou == false) throw new Exception('发货地址添加创建失败');
                                 else {
                                 	    //修改状态,添加待办
-		                            $roleid = Config('app.wsm_cgder_role');
+                                	    if ($is_stock==1){
+                                	    	$roleid = Config('app.wsm_cgder_role');
 		                            $uids = Db::name('user_role')
 		                                ->where('is_del', 0)
 		                                ->whereIn('roleid', $roleid)
 		                                ->column('uid');
+		                            $handle_user_list=implode(',', $uids);
+                                	    }
+
                                     //修改状态,添加待办
                                     ActionLog::logAdd(['id' => $rm, 'nickname' => $ri], [
                                         "order_code" => $outCode,//出库单号
@@ -429,11 +433,11 @@ class ImportOrderFromCHandleData extends Command
                                     ProcessOrder::AddProcess(['id' => $rm, 'nickname' => $ri], [
                                         "order_type" => 'CKD',
                                         "order_code" => $outCode,//出库单号
-                                        "order_id" => 0,
-                                        "order_status" => 0,
+                                        "order_id" => $ou,
+                                        "order_status" => $is_stock == 1 ? 1 : 0,
                                         "before_status" => 0,
                                         'holder_id' =>  $rm,
-                                        'handle_user_list' => $is_stock==1?implode(',', $uids):""
+                                        'handle_user_list' =>$handle_user_list??""
                                     ]);
 
                                     $standing_book_data['outCode'] = $outCode;