From 2d10a79e5479d198f364bf0448df9348755f36a0 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sun, 1 Sep 2024 12:37:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0'export'=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E4=BB=B7=E5=80=BC=E8=AE=A1=E7=AE=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lists/store_branch_product/StoreBranchProductLists.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/admin/lists/store_branch_product/StoreBranchProductLists.php b/app/admin/lists/store_branch_product/StoreBranchProductLists.php index 6b2f16248..106b3ca66 100644 --- a/app/admin/lists/store_branch_product/StoreBranchProductLists.php +++ b/app/admin/lists/store_branch_product/StoreBranchProductLists.php @@ -66,6 +66,7 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI public function lists(): array { $class_all = $this->request->get('class_all'); + $export=$this->request->get('export'); $where = []; if ($class_all) { $arr = Cate::where('pid', $class_all)->column('id'); @@ -89,10 +90,13 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI ->limit($this->limitOffset, $this->limitLength) ->order($this->sortOrder) ->select() - ->each(function ($item) { + ->each(function ($item) use($export) { $item['system_store_name'] = SystemStore::where('id', $item['store_id'])->value('name'); $item['unit_name'] = StoreProductUnit::where('id', $item['unit'])->value('name'); $item['cate_name'] = StoreCategory::where('id', $item['cate_id'])->value('name'); + if($export==2){ + $item['total_price'] = bcmul($item['purchase'],$item['stock'],2); + } return $item; }) ->toArray(); @@ -150,6 +154,7 @@ class StoreBranchProductLists extends BaseAdminDataLists implements ListsSearchI 'vip_price' => '会员价', 'price' => '零售价', 'bar_code' => '条码', + 'total_price' => '价值', ]; return $data; }