From 3bbf9476742224f1fbf93d3ea3bea659d683235b Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 14 Jun 2024 15:34:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E4=B8=8A=E4=BC=A0=E5=87=AD?= =?UTF-8?q?=E8=AF=81=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialTransfersController.php | 27 ++++++++++++++++++- .../FinancialTransfersLogic.php | 7 +++-- .../FinancialTransfersValidate.php | 7 +++++ .../FinancialTransfers.php | 2 +- .../finance/FinancialTransfersController.php | 2 +- 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/app/admin/controller/financial_transfers/FinancialTransfersController.php b/app/admin/controller/financial_transfers/FinancialTransfersController.php index bda5429f..c014be0b 100644 --- a/app/admin/controller/financial_transfers/FinancialTransfersController.php +++ b/app/admin/controller/financial_transfers/FinancialTransfersController.php @@ -29,17 +29,42 @@ class FinancialTransfersController extends BaseAdminController return $this->dataLists(new FinancialTransfersLists()); } + //确认 public function send_transfers() { $params = (new FinancialTransfersValidate())->post()->goCheck('send'); $result = FinancialTransfersLogic::dealsend($params); if (true === $result) { - return $this->success('发送成功', [], ); + return $this->success('发送成功', [],1,1 ); } return $this->fail(FinancialTransfersLogic::getError()); } + + //财务上传凭证 + public function success_send() + { + $params = (new FinancialTransfersValidate())->post()->goCheck('success'); + $update = [ + 'transfer_picture'=>$params['transfer_picture'] + ]; + $update['status'] = -1; + if($params['status']){ + $update['status'] = 3; + $update['pay_status'] = 1; + } + $update['fail_msg'] = $params['fail_msg']??''; + $result = FinancialTransfersLogic::dealchange($update,$params['id']); + + if (true === $result) { + return $this->success('转账成功' ); + } + return $this->fail(FinancialTransfersLogic::getError()); + + } + + diff --git a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php index 4f48f25a..8a571e70 100644 --- a/app/admin/logic/financial_transfers/FinancialTransfersLogic.php +++ b/app/admin/logic/financial_transfers/FinancialTransfersLogic.php @@ -132,9 +132,8 @@ class FinancialTransfersLogic extends BaseLogic } - public static function storeConfirmation($params,$id) + public static function dealchange($params,$id) { - Db::startTrans(); try { FinancialTransfers::where('id',$id) @@ -150,8 +149,8 @@ class FinancialTransfersLogic extends BaseLogic return false; } - + } - + } \ No newline at end of file diff --git a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php index fa828664..ff106e15 100644 --- a/app/admin/validate/financial_transfers/FinancialTransfersValidate.php +++ b/app/admin/validate/financial_transfers/FinancialTransfersValidate.php @@ -23,6 +23,7 @@ class FinancialTransfersValidate extends BaseValidate 'store_id' => 'require', 'money' => 'require', 'status' => 'require|number', + 'transfer_picture' => 'require', ]; @@ -35,6 +36,7 @@ class FinancialTransfersValidate extends BaseValidate 'store_id' => '店铺id', 'money' => '金额', 'status' => '状态', + 'transfer_picture' => '财务上传凭证', ]; @@ -49,6 +51,11 @@ class FinancialTransfersValidate extends BaseValidate return $this->only(['id','status']); } + public function sceneSuccess() + { + return $this->only(['id','transfer_picture','status']); + } + /** diff --git a/app/common/model/financial_transfers/FinancialTransfers.php b/app/common/model/financial_transfers/FinancialTransfers.php index ff7eaa69..dede4d2f 100644 --- a/app/common/model/financial_transfers/FinancialTransfers.php +++ b/app/common/model/financial_transfers/FinancialTransfers.php @@ -25,7 +25,7 @@ class FinancialTransfers extends BaseModel public function store() { return $this->hasOne(SystemStore::class, 'id','store_id') - ->bind(['store_name'=>'name', 'store_phone'=>'phone','store_detailed_address'=>'detailed_address','store_simple_address'=>'address']); + ->bind(['store_name'=>'name', 'store_phone'=>'phone','store_detailed_address'=>'detailed_address','store_simple_address'=>'address','store_bank'=>'bank','store_bank_code'=>'bank_code','store_bank_address'=>'bank_address','store_realName'=>'realname']); } diff --git a/app/store/controller/finance/FinancialTransfersController.php b/app/store/controller/finance/FinancialTransfersController.php index 5278a430..850222a6 100644 --- a/app/store/controller/finance/FinancialTransfersController.php +++ b/app/store/controller/finance/FinancialTransfersController.php @@ -60,7 +60,7 @@ class FinancialTransfersController extends BaseAdminController $data['confirmation_time'] = time(); } $data['status'] = $status; - $result = FinancialTransfersLogic::storeConfirmation($data,$params['id']); + $result = FinancialTransfersLogic::dealchange($data,$params['id']); if (true === $result) { return $this->success('操作成功' );