From 590a4abc4b603b64590bca8c94c390fb4a3e2955 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 20 Nov 2024 13:57:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(purchase):=20=E4=BF=AE=E5=A4=8D=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E4=BA=A7=E5=93=81=E6=8A=A5=E4=BB=B7=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=8D=95=E4=BD=8D=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正了单位名称的查询逻辑,使用正确的字段 'unit' 替代 'unit_id' - 添加了买家名称的查询和显示 - 优化了代码结构,提高了可读性和维护性 --- .../purchase_product_offer/PurchaseProductOfferLogic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 51a7cfbe8..2bab83798 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -13,6 +13,7 @@ use app\common\model\dict\DictData; use app\common\model\store_product\StoreProduct; use app\common\model\store_product_price\StoreProductPrice; use app\common\model\store_product_unit\StoreProductUnit; +use app\common\model\user\User; use app\common\service\workWechat\ProductOffer; use support\exception\BusinessException; use think\facade\Db; @@ -139,7 +140,7 @@ class PurchaseProductOfferLogic extends BaseLogic ]); $find = StoreProductPrice::where(['offer_id' => $params['id']])->find(); $product = StoreProduct::where('id', $offer['product_id'])->withTrashed()->field('store_name,top_cate_id')->find(); - $unit_name=StoreProductUnit::where('id', $offer['unit_id'])->value('name'); + $unit_name=StoreProductUnit::where('id', $offer['unit'])->value('name'); $dict_data = DictData::where('type_value', 'price_lv_' . $product['top_cate_id'])->field('name,value')->select(); $data = []; $data['bhoid'] = $offer['order_id']; @@ -172,6 +173,7 @@ class PurchaseProductOfferLogic extends BaseLogic Db::commit(); $offer['store_name']=$product['store_name']; $offer['unit_name']=$unit_name; + $offer['buyer_name']=User::where('id',$offer['buyer_id'])->value('real_name'); if($offer['pay_type']==1){ $offer['pay_type_name']='赊账'; }elseif($offer['pay_type']==2){