cqpCow 2 年之前
父节点
当前提交
751ae5ab60
共有 2 个文件被更改,包括 12 次插入1 次删除
  1. 11 0
      app/Service/FyyOrderService.php
  2. 1 1
      app/Service/FyySqlServerService.php

+ 11 - 0
app/Service/FyyOrderService.php

@@ -54,6 +54,17 @@ class FyyOrderService extends Service
                 $return[$key]['crt_time'] = time();
             }
 
+            $args = '';
+            if(! empty($return_stock_detail)){
+                foreach ($return_stock_detail as $value){
+                    $args .= "(product_no = '{$value['product_no']}' and technology_name = '{$value['technology_name']}' and wood_name = '{$value['wood_name']}') OR ";
+                }
+                $args = rtrim($args,'OR ');
+                SaleOrdersProductStockDetail::where('del_time',0)
+                    ->whereRaw("($args)")
+                    ->update(['del_time' => time()]);
+            }
+
             Orders::insert($orders);
             SaleOrdersProduct::insert($return);
             SaleOrdersProductStockDetail::insert($return_stock_detail);

+ 1 - 1
app/Service/FyySqlServerService.php

@@ -105,7 +105,7 @@ class FyySqlServerService extends Service
     public function getDataFromSqlServer($data){
         if(empty($data['out_order_no_time'][0]) || empty($data['out_order_no_time'][1])) return [false,'制单日期不能为空!',''];
         $bool = $this->is_same_month($data['out_order_no_time'][0],$data['out_order_no_time'][1]);
-        if(! $bool) return [false,'制单日期必须同月!'];
+        if(! $bool) return [false,'制单日期必须同月!',''];
 
         //查询产品主表副表数据
         date_default_timezone_set("PRC");