From 402058e12217e67ec68d7dfd4402006f8e00a2f0 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 1 Jul 2024 11:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=EF=BC=9A=E6=83=A0=E6=B0=91?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=9F=BA=E6=9C=AC=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/ExchangeQuotaRepository.php | 20 ++++++++++ app/controller/admin/user/ExchangeQuota.php | 40 ++++++++++++++++++- route/admin/marketing.php | 11 ++++- 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/user/ExchangeQuotaRepository.php b/app/common/repositories/user/ExchangeQuotaRepository.php index 2f6aa8e..8e0dc29 100644 --- a/app/common/repositories/user/ExchangeQuotaRepository.php +++ b/app/common/repositories/user/ExchangeQuotaRepository.php @@ -163,6 +163,26 @@ class ExchangeQuotaRepository extends BaseRepository{ } + /** + * Common: 设置获取 + * Author: wu-hui + * Time: 2024/07/01 10:52 + * @return mixed + */ + public function getConfig(){ + $config = systemConfig([ + 'quota_integral_rate', + 'quota_integral_diff_rate', + 'quota_integral_upgrade_switch', + 'quota_integral_upgrade_money', + 'quota_integral_upgrade_level', + ]); + // 信息处理 + $config['quota_integral_upgrade_switch'] = (int)$config['quota_integral_upgrade_switch']; + + + return $config; + } } diff --git a/app/controller/admin/user/ExchangeQuota.php b/app/controller/admin/user/ExchangeQuota.php index 24ddb4a..72c9a5a 100644 --- a/app/controller/admin/user/ExchangeQuota.php +++ b/app/controller/admin/user/ExchangeQuota.php @@ -3,6 +3,9 @@ namespace app\controller\admin\user; use app\common\model\user\ExchangePickupPoint; +use app\common\repositories\marketing\AgentRepository; +use app\common\repositories\system\config\ConfigClassifyRepository; +use app\common\repositories\system\config\ConfigValueRepository; use app\common\repositories\user\ExchangeIntegralRecordRepository; use app\common\repositories\user\ExchangePickupPointRepository; use app\common\repositories\user\ExchangePickupRecordRepository; @@ -12,9 +15,10 @@ use crmeb\basic\BaseController; use app\common\model\user\User; -class ExchangeQuota extends BaseController -{ +class ExchangeQuota extends BaseController{ + protected $repository; + /** * Common: 额度信息 - 统计 * Author: wu-hui @@ -190,6 +194,38 @@ class ExchangeQuota extends BaseController } + /** + * Common: 配置信息 - 修改 + * Author: wu-hui + * Time: 2024/07/01 10:15 + * @return mixed + */ + public function setConfig(){ + $config = $this->request->params([ + ['quota_integral_rate',0],// 赠送比例 + ['quota_integral_diff_rate',0],// 补差折扣,以原价的百分之多少进行现金支付 + ['quota_integral_upgrade_switch',0],// 是否开启消费升级 + ['quota_integral_upgrade_money',0],// 升级分销商要求金额 + ['quota_integral_upgrade_level',0],// 升级后等级 + ]); + // 保存信息 + $cid = app()->make(ConfigClassifyRepository::class)->getConfigClassifyKeyById('quota_config', '额度与积分配置'); + if (!$cid) return app('json')->fail('保存失败'); + app()->make(ConfigValueRepository::class)->setFormData($config,$this->request->merId()); + return app('json')->success('保存成功'); + } + /** + * Common: 配置信息 - 获取 + * Author: wu-hui + * Time: 2024/07/01 10:15 + * @return mixed + */ + public function getConfig(){ + $config = app()->make(ExchangeQuotaRepository::class)->getConfig(); + + return app('json')->success($config); + } + } diff --git a/route/admin/marketing.php b/route/admin/marketing.php index 3018552..d24dbdf 100644 --- a/route/admin/marketing.php +++ b/route/admin/marketing.php @@ -426,7 +426,7 @@ Route::group(function () { ]); // 酒卡额度 Route::group('user/exchange_quota', function () { - // 酒卡额度相关 + // 酒卡额度相关管理 Route::get('quota_title','.ExchangeQuota/quotaTitle')->name('systemUserExchangeQuotaTitle')->option([ '_alias' => '额度统计', ]); @@ -436,6 +436,15 @@ Route::group(function () { Route::get('quota_record_list', '.ExchangeQuota/quotaRecordList')->name('systemUserExchangeQuotaRecordList')->option([ '_alias' => '额度变更记录', ]); + // 酒卡额度相关设置 + Route::get('quota_get_config','.ExchangeQuota/getConfig')->name('systemUserExchangeQuotaConfigGet')->option([ + '_alias' => '配置获取', + ]); + Route::post('quota_set_config','.ExchangeQuota/setConfig')->name('systemUserExchangeQuotaConfigSet')->option([ + '_alias' => '编辑配置', + ]); + + // 兑换积分相关 Route::get('integral_title','.ExchangeQuota/integralTitle')->name('systemUserExchangeIntegralTitle')->option([ '_alias' => '积分统计',