diff --git a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php index aa1c78a28..59e00eb82 100644 --- a/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php +++ b/app/admin/lists/beforehand_order_cart_info/BeforehandOrderCartInfoLists.php @@ -77,7 +77,7 @@ class BeforehandOrderCartInfoLists extends BaseAdminDataLists implements ListsSe } } $list = BeforehandOrderCartInfo::where($this->searchWhere) - ->field(['id', 'bhoid', 'package', 'store_info', 'marques', 'gross_weight', 'net_weight', 'accept_num', 'after_sales', 'loss', 'uid', 'pay_price', 'is_buyer', 'buyer_uid', 'product_id', 'attr_value_id', 'purchase', 'price', 'total_price', 'cart_num', 'mark','create_time']) + ->field(['id', 'bhoid', 'package', 'store_info', 'marques', 'gross_weight', 'net_weight', 'accept_num', 'after_sales', 'loss', 'uid', 'pay_price', 'is_buyer', 'buyer_uid', 'product_id', 'attr_value_id', 'purchase', 'price', 'total_price', 'cart_num', 'mark','create_time', 'procurement_order_id']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) use ($system_store, $order_mark) { diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 430c25111..056c2af68 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -370,7 +370,7 @@ class BeforehandOrderLogic extends BaseLogic $info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select(); foreach ($info as $k => $v) { if ($v['pay_price'] <= 0) { - throw new BusinessException('商品价格未空 不能生成出库订单,对应id:' . $v['id']); + throw new BusinessException('商品价格为空 不能生成出库订单,对应id:' . $v['id']); } } $count = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('cart_num', 0)->count('id'); @@ -426,6 +426,7 @@ class BeforehandOrderLogic extends BaseLogic $finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find(); WarehouseOrder::where('id', $res['id'])->update(['total_price' => $finds['total_price'], 'nums' => $finds['nums']]); $order->save(['outbound_id' => $res['id'], 'is_outbound' => 1, 'pay_price' => $finds['total_price']]); + BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->update(['is_buyer' => -1]); Db::commit(); return true; } catch (\Throwable $e) { diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index f4a03517f..e060de826 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -99,7 +99,7 @@ class PurchaseProductOfferLogic extends BaseLogic ] ]); } - BeforehandOrderCartInfo::where(['bhoid' => $params['order_id'], 'product_id' => $params['product_id']])->update(['is_buyer' => 1]); + BeforehandOrderCartInfo::where(['bhoid' => $params['order_id'], 'product_id' => $params['product_id']])->update(['is_buyer' => 1, 'procurement_order_id' => $procurementOrder['id']]); Db::commit(); return true; } catch (\Exception $e) { diff --git a/app/functions.php b/app/functions.php index b24f7f659..62d3cde79 100644 --- a/app/functions.php +++ b/app/functions.php @@ -556,9 +556,9 @@ function channelLog($data, $type, $title = '更新前') * @param pm 1:增加 -1:减少 * @param url 请求地址 */ -function SqlChannelLog($model='', $id=0, $nums=0,$pm=0,$url='',$admin_id=0):void +function SqlChannelLog($model='', $id=0, $nums=0,$pm=0,$url='',$admin_id=0, $remark = ''):void { - (new ChangeLogLogic())->insert($model, $id, $nums, $pm, $url,$admin_id); + (new ChangeLogLogic())->insert($model, $id, $nums, $pm, $url,$admin_id, $remark); } /** * 价格日志记录