From 43c749f48001dc69179492c77ba3d80f442fa5e1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 25 May 2024 14:14:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BC=95=E5=85=A5=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=B9=B6=E6=9B=B4=E6=96=B0=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/OpurchaseGoodsOfferController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/api/controller/operation/OpurchaseGoodsOfferController.php b/app/api/controller/operation/OpurchaseGoodsOfferController.php index 06b5238..e478f17 100644 --- a/app/api/controller/operation/OpurchaseGoodsOfferController.php +++ b/app/api/controller/operation/OpurchaseGoodsOfferController.php @@ -6,6 +6,8 @@ use app\api\controller\BaseApiController; use app\api\lists\operation\OpurchaseGoodsOfferList; use app\api\logic\operation\OpurchaseGoodsOfferLogic; use app\api\validate\OpurchaseGoodsOfferValidate; +use app\common\model\goods\Goods; +use app\common\model\goods\Goodsclass; use think\facade\Db; class OpurchaseGoodsOfferController extends BaseApiController @@ -29,8 +31,18 @@ class OpurchaseGoodsOfferController extends BaseApiController $page_no = $this->request->get('page_no', 1); $page_size = $this->request->get('page_size', 15); - $data = Db::name('opurchase_goods_offer_date')->where('supplier_id', $supplier['id'])->page($page_no, $page_size)->select()->each(function ($item) { + $data = Db::name('opurchase_goods_offer_date')->where('supplier_id', $supplier['id'])->page($page_no, $page_size)->select() + ->each(function ($item) { $item['name']=date('Y-m-d', $item['create_time']).' 报价清单'; + $item['class_arr']=[]; + $goods_id=Db::name('opurchase_goods_offer')->whereDay('create_time',$item['name'])->where('supplier_id', $item['supplier_id'])->limit(3)->column('goods_id'); + if($goods_id){ + $class=Goods::where('id','in',$goods_id)->column('class'); + if($class){ + $name=Goodsclass::where('id','in',$class)->column('name'); + $item['class_arr']=$name; + } + } return $item; })->toArray(); $count = Db::name('opurchase_goods_offer_date')->where('supplier_id', $supplier['id'])->count();