|
@@ -432,8 +432,8 @@ class Sale extends Base
|
|
|
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')]));
|
|
|
- }else Db::name('standing_book')->insert(array_merge($standing_book_da, ['addtime' => date('Y-m-d H:i:s')]));
|
|
|
+ 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')]));
|
|
|
|
|
|
Db::commit();
|
|
|
return error_show(0,"咨询订单创建成功",["order_code"=>$orderCode]);
|
|
@@ -774,12 +774,7 @@ class Sale extends Base
|
|
|
]);
|
|
|
|
|
|
//处理台账-既然是根据orderCode更新的数据,那么肯定是有数据的,只需要更新就行了
|
|
|
- $standing_book_id = Db::name('standing_book')->where('orderCode', $orderCode)->value('id');
|
|
|
- if (!empty($standing_book_id)) {
|
|
|
- Db::name('standing_book')
|
|
|
- ->where('id', $standing_book_id)
|
|
|
- ->update(['outCode' => $outCode, 'updatetime' => date('Y-m-d H:i:s')]);
|
|
|
- }
|
|
|
+ Db::name('standing_book')->where('orderCode', $orderCode)->update(['outCode' => $outCode, 'updatetime' => date('Y-m-d H:i:s')]);
|
|
|
}
|
|
|
|
|
|
//维护商品所在仓库的库存 --- end
|