From 33857f15df52a109cfcc635c51f135166422d338 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 7 Jun 2024 16:51:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BA=86StoreFinance?= =?UTF-8?q?FlowLists=E5=92=8CStoreFinanceFlowWeekLists=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86SystemStoreStorageLists=E7=B1=BB?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lists/store_finance_flow/StoreFinanceFlowLists.php | 10 +--------- .../store_finance_flow/StoreFinanceFlowWeekLists.php | 2 +- .../system_store_storage/SystemStoreStorageLists.php | 6 ++++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php index b08e56912..c4e39bbd3 100644 --- a/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php +++ b/app/admin/lists/store_finance_flow/StoreFinanceFlowLists.php @@ -32,6 +32,7 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt { return [ '=' => ['store_id', 'user_id', 'create_time', 'staff_id'], + 'between_time'=>'create_time', ]; } @@ -48,15 +49,6 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt public function lists(): array { return StoreFinanceFlow::where($this->searchWhere) - ->when(!empty($this->params['start_time']), function ($query) { - $query->whereTime('create_time', '>=', $this->params['start_time']); - }) - ->when(!empty($this->params['end_time']), function ($query) { - if ($this->params['end_time'] == $this->params['start_time']) { - $this->params['end_time'] = strtotime($this->params['end_time']) + 86399; - } - $query->whereTime('create_time', '<=', $this->params['end_time']); - }) ->when(!empty($this->request->adminInfo['store_id']), function ($query) { $query->where('store_id', $this->request->adminInfo['store_id']); }) diff --git a/app/admin/lists/store_finance_flow/StoreFinanceFlowWeekLists.php b/app/admin/lists/store_finance_flow/StoreFinanceFlowWeekLists.php index 33cf129f7..353c81810 100644 --- a/app/admin/lists/store_finance_flow/StoreFinanceFlowWeekLists.php +++ b/app/admin/lists/store_finance_flow/StoreFinanceFlowWeekLists.php @@ -45,7 +45,7 @@ class StoreFinanceFlowWeekLists extends BaseAdminDataLists implements ListsSearc { return StoreFinanceFlow::where($this->searchWhere) ->field(' - CONCAT("第", YEARweek(FROM_UNIXTIME(create_time, "%Y-%m-%d")), "周(", MONTH(FROM_UNIXTIME(create_time, "%Y-%m-%d")), "月)") as date, + CONCAT("第", LPAD(YEAR(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 4, "0"), "-", LPAD(WEEK(FROM_UNIXTIME(create_time, "%Y-%m-%d"), 3), 2, "0"), "周(", LPAD(MONTH(FROM_UNIXTIME(create_time, "%Y-%m-%d")), 2, "0"), "月)") as date, SUM(CASE WHEN financial_pm = 1 THEN number ELSE 0 END) as income, SUM(CASE WHEN financial_pm = 0 THEN number ELSE 0 END) as expenditure ') diff --git a/app/admin/lists/system_store_storage/SystemStoreStorageLists.php b/app/admin/lists/system_store_storage/SystemStoreStorageLists.php index 5918a2e69..2894616c4 100644 --- a/app/admin/lists/system_store_storage/SystemStoreStorageLists.php +++ b/app/admin/lists/system_store_storage/SystemStoreStorageLists.php @@ -46,7 +46,7 @@ class SystemStoreStorageLists extends BaseAdminDataLists implements ListsSearchI public function lists(): array { return SystemStoreStorage::where($this->searchWhere) - ->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums', 'status']) + ->field(['id', 'store_id', 'admin_id', 'staff_id', 'product_id', 'nums','mark', 'status']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function($item){ @@ -58,7 +58,9 @@ class SystemStoreStorageLists extends BaseAdminDataLists implements ListsSearchI }else{ $item['staff_name']='无'; } - $item['store_name']=StoreProduct::where('id',$item['product_id'])->value('store_name'); + $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image')->find(); + $item['store_name']=$find['store_name']; + $item['image']=$find['image']; return $item; }) ->toArray();