From a21727f09b97d0b7eb0061814833fbaf5ace666a Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 14 Jun 2024 15:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=8F=90=E7=8E=B0=E5=88=97?= =?UTF-8?q?=E8=A1=A8,=E5=90=8E=E5=8F=B0=E8=AE=BE=E7=BD=AE=E5=95=86?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E6=8F=90=E7=8E=B0=E9=93=B6=E8=A1=8C=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lists/system_store/SystemStoreLists.php | 4 +- .../FinancialTransfersLogic.php | 22 ++++++ .../logic/system_store/SystemStoreLogic.php | 8 ++ .../FinancialTransfersValidate.php | 8 ++ .../finance/FinancialTransfersController.php | 75 +++++++++++++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 app/store/controller/finance/FinancialTransfersController.php diff --git a/app/admin/lists/system_store/SystemStoreLists.php b/app/admin/lists/system_store/SystemStoreLists.php index 40b3804e..d961fcce 100644 --- a/app/admin/lists/system_store/SystemStoreLists.php +++ b/app/admin/lists/system_store/SystemStoreLists.php @@ -44,7 +44,9 @@ class SystemStoreLists extends BaseAdminDataLists implements ListsSearchInterfac public function lists(): array { return SystemStore::where($this->searchWhere) - ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show','day_start','day_end']) + ->field(['id', 'name', 'phone', 'detailed_address', 'image', 'is_show','day_start','day_end' + ,'bank','bank_code','bank_address','realname' + ]) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item){ diff --git a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php index 05626665..4f48f25a 100644 --- a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php +++ b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php @@ -130,6 +130,28 @@ class FinancialTransfersLogic extends BaseLogic } + + + public static function storeConfirmation($params,$id) + { + + Db::startTrans(); + try { + FinancialTransfers::where('id',$id) + ->update( + $params + ); + + Db::commit(); + return true; + }catch (\Exception $e) { + Db::rollback(); + self::setError($e->getMessage()); + return false; + } + + + } } \ No newline at end of file diff --git a/app/admin/logic/system_store/SystemStoreLogic.php b/app/admin/logic/system_store/SystemStoreLogic.php index 85324743..695ea00b 100644 --- a/app/admin/logic/system_store/SystemStoreLogic.php +++ b/app/admin/logic/system_store/SystemStoreLogic.php @@ -45,6 +45,10 @@ class SystemStoreLogic extends BaseLogic 'province' => $params['province_code'], 'city' => $params['city_code'], 'area' => $params['area_code'], + 'bank' => $params['bank']??'', + 'bank_code' => $params['bank_code']??'', + 'bank_address' => $params['bank_address']??'', + 'realname' => $params['realname']??'', 'street' => $params['street_code'], 'is_store' => $params['is_store'] ?? 0, 'is_send' => $params['is_send'] ?? 0, @@ -102,6 +106,10 @@ class SystemStoreLogic extends BaseLogic 'day_time' => $params['day_time'] ?? 0, 'is_store' => $params['is_store'] ?? 0, 'is_send' => $params['is_send'] ?? 0, + 'bank' => $params['bank']??'', + 'bank_code' => $params['bank_code']??'', + 'bank_address' => $params['bank_address']??'', + 'realname' => $params['realname']??'', 'default_delivery' => $params['default_delivery'] ?? 2, ]); $res=SystemStoreStaff::where('store_id', $params['id'])->where('is_admin', 1)->where('account', $params['phone'])->find(); diff --git a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php index f655002f..fa828664 100644 --- a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php +++ b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php @@ -22,6 +22,7 @@ class FinancialTransfersValidate extends BaseValidate 'id' => 'require', 'store_id' => 'require', 'money' => 'require', + 'status' => 'require|number', ]; @@ -33,6 +34,7 @@ class FinancialTransfersValidate extends BaseValidate 'id' => 'id', 'store_id' => '店铺id', 'money' => '金额', + 'status' => '状态', ]; @@ -42,6 +44,12 @@ class FinancialTransfersValidate extends BaseValidate } + public function sceneConfirm() + { + return $this->only(['id','status']); + } + + /** * @notes 添加场景 diff --git a/app/store/controller/finance/FinancialTransfersController.php b/app/store/controller/finance/FinancialTransfersController.php new file mode 100644 index 00000000..5278a430 --- /dev/null +++ b/app/store/controller/finance/FinancialTransfersController.php @@ -0,0 +1,75 @@ +dataLists(new FinancialTransfersLists()); + } + + + #[ + ApiDoc\Title('店铺确认'), + ApiDoc\url('/store/finance/financialTransfers/confirmation'), + ApiDoc\Method('POST'), + ApiDoc\NotHeaders(), + ApiDoc\Author('中国队长'), + ApiDoc\Query(name: 'status', type: 'int', require: true, desc: '状态1确认 0不确认'), + ApiDoc\Query(name: 'id', type: 'int', require: true, desc: '数据id'), + ApiDoc\Query(name: 'mark', type: 'string', require: false, desc: '原因/备注'), + ApiDoc\Header(ref: [Definitions::class, "token"]), + ApiDoc\Query(ref: [Definitions::class, "page"]), + ApiDoc\ResponseSuccess("data", type: "array"), + ] + public function confirmation() + { + $params = (new FinancialTransfersValidate())->post()->goCheck('confirm'); + + $staff_id = $this->request->adminInfo['admin_id']??5; + $data = [ + 'store_staff_id' => $staff_id, + 'mark' => $params['mark']??'', + ]; + $status = -2; + if ($params['status']) { + $status = 2; + $data['confirmation_time'] = time(); + } + $data['status'] = $status; + $result = FinancialTransfersLogic::storeConfirmation($data,$params['id']); + + if (true === $result) { + return $this->success('操作成功' ); + } + return $this->fail(FinancialTransfersLogic::getError()); + + + + } + + +} \ No newline at end of file