Kaynağa Gözat

根据备库单的采购单更新台账记录

wufeng 2 yıl önce
ebeveyn
işleme
0662386f41
1 değiştirilmiş dosya ile 2 ekleme ve 5 silme
  1. 2 5
      app/admin/controller/Sale.php

+ 2 - 5
app/admin/controller/Sale.php

@@ -437,11 +437,8 @@ class Sale extends Base
 
                 //处理台账
                 if (isset($standing_book_da['outCode'])) $standing_book_da['outCode'] = implode(',', $standing_book_da['outCode']);//发货单号拼接
-                if (isset($standing_book_da['bk_code'])) {
-                    $temp = Db::name('standing_book')->field('id')->where('bk_code', $standing_book_da['bk_code'])->find();
-                    if (!empty($temp)) Db::name('standing_book')->where('id', $temp['id'])->update($standing_book_da);
-                    else Db::name('standing_book')->insert(array_merge($standing_book_da, ['addtime' => date('Y-m-d H:i:s'), 'standBookNo' => makeNo('IO')]));
-                } else Db::name('standing_book')->insert(array_merge($standing_book_da, ['addtime' => date('Y-m-d H:i:s'), 'standBookNo' => makeNo('IO')]));
+                if (isset($standing_book_da['cgdNo'])) Db::name('standing_book')->where('cgdNo', $standing_book_da['cgdNo'])->update($standing_book_da);
+                else Db::name('standing_book')->insert(array_merge($standing_book_da, ['addtime' => date('Y-m-d H:i:s'), 'standBookNo' => makeNo('IO')]));
 
                 Db::commit();
                 return error_show(0,"咨询订单创建成功",["order_code"=>$orderCode]);