feat(api): 为采购产品报价列表添加订单ID字段

- 在 PurchaseProductOfferListsTwo 类中添加了 order_id 字段
- 通过查询 BeforehandOrder 模型获取 store_id 并赋值给 order_id
- 此修改使得 API 返回数据中包含订单ID信息,可能用于前端显示或后续处理
This commit is contained in:
mkm 2024-11-20 17:05:59 +08:00
parent 85997befc8
commit fc4798fd07

@ -11,6 +11,7 @@ use app\common\model\store_product_unit\StoreProductUnit;
use app\api\lists\BaseApiDataLists;
use app\common\model\store_category\StoreCategory;
use app\common\lists\ListsExcelInterface;
use app\common\model\beforehand_order\BeforehandOrder;
use app\common\model\user\User;
/**
@ -54,6 +55,7 @@ class PurchaseProductOfferListsTwo extends BaseApiDataLists implements ListsSear
->select()->each(function($item){
$find=StoreProduct::where('id',$item->product_id)->find();
$item->store_name=$find->store_name;
$item->order_id=BeforehandOrder::where('id',$item->order_id)->value('store_id');
$item->unit_name=StoreProductUnit::where('id',$item->unit)->value('name');
$item->category_name=StoreCategory::where('id',$find->top_cate_id)->value('name');
$item->buyer_name=DeliveryService::where('uid',$item->buyer_id)->value('nickname');