From 23d582ca98b246b059047af85d12a44cead7fb84 Mon Sep 17 00:00:00 2001 From: lanzu_qsy <334039090@qq.com> Date: Tue, 25 Aug 2020 18:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=85=AC=E5=8F=B8=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LanzuCsWithdrawController.php | 12 ++++++++++++ app/Models/FinancialRecord.php | 13 ++++++++----- app/Models/LanzuFinancialRecord.php | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 app/Models/LanzuFinancialRecord.php diff --git a/app/Admin/Controllers/LanzuCsWithdrawController.php b/app/Admin/Controllers/LanzuCsWithdrawController.php index 809d65d..0e9cab7 100644 --- a/app/Admin/Controllers/LanzuCsWithdrawController.php +++ b/app/Admin/Controllers/LanzuCsWithdrawController.php @@ -82,6 +82,7 @@ class LanzuCsWithdrawController extends AdminController */ protected function form() { + return Form::make(new LanzuCsWithdraw('csInfo'), function (Form $form) { $form->display('id'); $user = Admin::user(); @@ -145,6 +146,17 @@ class LanzuCsWithdrawController extends AdminController $model->desc = '社区站点提现'; $model->comment = '社区站点提现'; $model->save(); + + //添加公司流水 + $model = new \App\Models\LanzuFinancialRecord(); + $model->user_id = -1; + $model->user_type = -1; + $model->money = $form->model()->money; + $model->money_type = 104; + $model->desc = '社区站点提现'; + $model->comment = '社区站点提现'; + $model->save(); + } else { //记录失败日志 Log::error('提现失败.', $res); diff --git a/app/Models/FinancialRecord.php b/app/Models/FinancialRecord.php index 424b841..d3c46b3 100644 --- a/app/Models/FinancialRecord.php +++ b/app/Models/FinancialRecord.php @@ -15,11 +15,14 @@ class FinancialRecord extends Model * @return string */ public static function getFinancialRecordModel($user_id){ - $buider = null; - $index = $user_id % 5; - $model_name = 'App\\Models\\'.'FinancialRecord'.$index; - $buider = new $model_name(); - return $buider; + if ($user_id){ + $buider = null; + $index = $user_id % 5; + $model_name = 'App\\Models\\'.'FinancialRecord'.$index; + $buider = new $model_name(); + return $buider; + } + } } diff --git a/app/Models/LanzuFinancialRecord.php b/app/Models/LanzuFinancialRecord.php new file mode 100644 index 0000000..9350270 --- /dev/null +++ b/app/Models/LanzuFinancialRecord.php @@ -0,0 +1,15 @@ +