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; }