mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改用户余额升级
This commit is contained in:
parent
57eed3eaed
commit
d60e59b3c5
@ -11,7 +11,7 @@
|
||||
Target Server Version : 80018
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 07/04/2021 11:29:47
|
||||
Date: 07/04/2021 13:37:02
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
@ -27,7 +27,7 @@ CREATE TABLE `data_base_discount` (
|
||||
`items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '方案规则',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '方案描述',
|
||||
`sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重',
|
||||
`status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)',
|
||||
`status` tinyint(1) NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)',
|
||||
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态',
|
||||
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
@ -332,7 +332,7 @@ CREATE TABLE `data_user_balance` (
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '充值名称',
|
||||
`remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '充值备注',
|
||||
`amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '充值金额',
|
||||
`vip_upgrade` tinyint(20) NULL DEFAULT 0 COMMENT '强制升级',
|
||||
`upgrade` tinyint(20) NULL DEFAULT 0 COMMENT '强制升级',
|
||||
`deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
|
||||
`create_by` bigint(20) NULL DEFAULT 0 COMMENT '系统用户',
|
||||
`create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
@ -774,7 +774,7 @@ CREATE TABLE `system_config` (
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_system_config_type`(`type`) USING BTREE,
|
||||
INDEX `idx_system_config_name`(`name`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 27 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-配置' ROW_FORMAT = COMPACT;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-配置' ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for system_data
|
||||
@ -821,7 +821,7 @@ CREATE TABLE `system_oplog` (
|
||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作人用户名',
|
||||
`create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 198 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT;
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 202 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '系统-日志' ROW_FORMAT = COMPACT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for system_queue
|
||||
|
@ -38,7 +38,7 @@ class Balance extends Controller
|
||||
// 现有余额类型
|
||||
$this->names = $this->app->db->name($this->table)->group('name')->column('name');
|
||||
// 创建查询对象
|
||||
$query = $this->_query($this->table)->equal('name,vip_upgrade');
|
||||
$query = $this->_query($this->table)->equal('name,upgrade');
|
||||
// 用户搜索查询
|
||||
$db = $this->_query('DataUser')->like('phone#user_phone,nickname#user_nickname')->db();
|
||||
if ($db->getOptions('where')) $query->whereRaw("uid in {$db->field('id')->buildSql()}");
|
||||
|
@ -107,7 +107,7 @@ class UserUpgradeService extends Service
|
||||
$orderNo = null;
|
||||
}
|
||||
// 后台余额充值升级
|
||||
$tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('vip_upgrade');
|
||||
$tmpCode = $this->app->db->name('DataUserBalance')->where(['uid' => $uid, 'deleted' => 0])->max('upgrade');
|
||||
if ($tmpCode > $vipCode) {
|
||||
$map = ['status' => 1, 'number' => $tmpCode];
|
||||
$upgrade = $this->app->db->name('DataBaseUpgrade')->where($map)->find();
|
||||
|
@ -46,9 +46,9 @@
|
||||
<div class="layui-form-item">
|
||||
<span class="color-green font-w7 label-required-prev">升级用户等级</span>
|
||||
<span class="color-desc margin-left-5">Upgrade</span>
|
||||
<select class="layui-select" lay-filter="vip_upgrade" name="vip_upgrade">
|
||||
<select class="layui-select" lay-filter="upgrade" name="upgrade">
|
||||
<option value="0">-- 不升级 --</option>
|
||||
{foreach $upgrades as $upgrade}{if isset($vo.vip_upgrade) and $vo.vip_upgrade eq $upgrade.number}
|
||||
{foreach $upgrades as $upgrade}{if isset($vo.upgrade) and $vo.upgrade eq $upgrade.number}
|
||||
<option selected value="{$upgrade.number|default=0}">升级到 [ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
|
||||
{else}
|
||||
<option value="{$upgrade.number|default=0}">升级到 [ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
|
||||
|
@ -19,9 +19,9 @@
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">升级等级</label>
|
||||
<div class="layui-input-inline">
|
||||
<select class="layui-select" name="vip_upgrade">
|
||||
<select class="layui-select" name="upgrade">
|
||||
<option value="">-- 全部 --</option>
|
||||
{foreach $upgrades as $upgrade}{if input('vip_upgrade') eq $upgrade.number}
|
||||
{foreach $upgrades as $upgrade}{if input('upgrade') eq $upgrade.number}
|
||||
<option selected value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
|
||||
{else}
|
||||
<option value="{$upgrade.number|default=0}">[ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
|
||||
|
Loading…
x
Reference in New Issue
Block a user