From 687e9daf83971720585b490186230186b9df91c9 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 5 Jan 2024 11:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E5=88=9B=E8=B1=86=E5=85=85=E5=80=BC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/admin/FundController.php | 47 +++++++- .../src/models/CulturalSpace.php | 2 +- .../cultural-space/views/fund/index.blade.php | 16 ++- .../views/fund/recharge.blade.php | 106 ++++++++++++++++++ 4 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 plugins/cultural-space/views/fund/recharge.blade.php diff --git a/plugins/cultural-space/src/admin/FundController.php b/plugins/cultural-space/src/admin/FundController.php index 2c7bfcfc..f2f620b0 100644 --- a/plugins/cultural-space/src/admin/FundController.php +++ b/plugins/cultural-space/src/admin/FundController.php @@ -2,6 +2,7 @@ namespace Yunshop\CulturalSpace\admin; use app\common\components\BaseController; use app\common\facades\Setting; +use app\common\helpers\Url; use Yunshop\CulturalSpace\models\CulturalFund; use Yunshop\CulturalSpace\models\CulturalOrderFundLog; use Yunshop\CulturalSpace\models\CulturalSpace; @@ -15,16 +16,20 @@ class FundController extends BaseController // $result =(new CulturalSpace())->GiveGoodsFundMoney(22,93); // } - $result =(new CulturalSpace())->GiveGoodsFundMoney(33,96); + // $result =(new CulturalSpace())->GiveGoodsFundMoney(33,96); // $set = Setting::get('plugin.cultural_space_set'); // $result =(new CulturalSpace())->capitalIncrease($set); - var_dump($result); + // var_dump($result); } public function index(){ - return view('Yunshop\CulturalSpace::fund.index')->render(); + $selectedTab = request()->input('selected_tab'); + + return view('Yunshop\CulturalSpace::fund.index',[ + 'selected_tab' => $selectedTab + ])->render(); } @@ -46,4 +51,40 @@ class FundController extends BaseController $result =CulturalOrderFundLog::getList($search); return $this->successJson('成功',$result); } + /** + * Common: 文创豆充值(后台手动充值) + * Author: wu-hui + * Time: 2024/01/05 11:39 + * @return array|mixed|string + * @throws \Throwable + */ + public function recharge(){ + if(\Request::isMethod('post')){ + $data = request()->input('data'); + $errorLink = Url::absoluteWeb('plugin.cultural-space.admin.fund.index',['selected_tab'=>'show_user']); + if((int)$data['uid'] <= 0) return $this->message('充值用户不明确!', $errorLink, 'error'); + if((float)$data['recharge_money'] <= 0) return $this->message('充值文创豆数量必须大于0!', $errorLink, 'error'); + // 获取用户文创空间信息 + try{ + (new CulturalSpace())->getCulturalSpace([$data['uid']]); + // 增加用户持有文创豆 + (new CulturalOrderFundLog())->transferHandle((int)$data['uid'],(float)$data['recharge_money'],0,"后台充值增加", 3); + + return $this->message('充值成功!', $errorLink, 'success'); + }catch(\Exception $e){ + return $this->message($e->getMessage(), $errorLink, 'error'); + } + } + + + return view('Yunshop\CulturalSpace::fund.recharge')->render(); + } + + + + + + + + } \ No newline at end of file diff --git a/plugins/cultural-space/src/models/CulturalSpace.php b/plugins/cultural-space/src/models/CulturalSpace.php index dd20a324..5b76ccca 100644 --- a/plugins/cultural-space/src/models/CulturalSpace.php +++ b/plugins/cultural-space/src/models/CulturalSpace.php @@ -297,7 +297,7 @@ class CulturalSpace extends BaseModel * @param $ids * @return array */ - private function getCulturalSpace($ids) + public function getCulturalSpace($ids) { // 获取已经存在的信息 $list = self::uniacid() diff --git a/plugins/cultural-space/views/fund/index.blade.php b/plugins/cultural-space/views/fund/index.blade.php index 082d2231..6ddd7ec6 100644 --- a/plugins/cultural-space/views/fund/index.blade.php +++ b/plugins/cultural-space/views/fund/index.blade.php @@ -79,7 +79,8 @@ - 查询 + 查询 + 充值 {{--表单--}} @@ -176,7 +177,7 @@ name: 'cultural_space_index_content', data: { fundData:[], - tabs_active: 'show_detail', + tabs_active: "{{$selected_tab}}" || 'show_detail', level_list: JSON.parse('{!! json_encode($level_list) !!}'), // 分页信息 page: 1, @@ -262,6 +263,17 @@ this.tabs_active = 'show_group'; this.getData() }, + // 充值文创豆 + rechargeLegumes(){ + // 查看店长业绩及补助信息 + let link = "{{yzWebUrl('plugin.cultural-space.admin.fund.recharge')}}"; + let popup = util.ajaxshow(link,'充值文创豆',{ + width: $(window).width() * 0.8 > 1200 ? $(window).width() * 0.8 : 1200, + height: $(window).height() * 0.8 > 1200 ? $(window).height() * 0.8 : 1200, + }); + } + + }, }) diff --git a/plugins/cultural-space/views/fund/recharge.blade.php b/plugins/cultural-space/views/fund/recharge.blade.php new file mode 100644 index 00000000..52b8861d --- /dev/null +++ b/plugins/cultural-space/views/fund/recharge.blade.php @@ -0,0 +1,106 @@ + + +
+
+
+
+
+ +
+ +
+ +
+ + +
+
+ + + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +