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 @@ + + +
+
+
+
+
+ +
+ +
+ +
+ + +
+
+ + + +
+
+
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+ +