Merge pull request 'feat(api): 为采购产品报价列表添加订单ID字段' (#353) from dev into main

Reviewed-on: #353
This commit is contained in:
mkm 2024-11-20 17:06:36 +08:00
commit 2de8aa2287

View File

@ -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');