This commit is contained in:
Anyon 2021-03-29 21:52:24 +08:00
commit 60a6edcc3b
7 changed files with 23 additions and 15 deletions

View File

@ -34,7 +34,7 @@ class Data extends Controller
$query = $this->_query('DataBaseMessage')->where(['status' => 1, 'deleted' => 0]);
$result = $query->equal('id')->order('sort desc,id desc')->page(true, false, false, 20);
if (($id = input('id')) > 0) {
$this->app->db->name('DataBaseNotify')->where(['id' => $id])->inc('num_read')->update();
$this->app->db->name('DataBaseMessage')->where(['id' => $id])->inc('num_read')->update();
}
$this->success('获取系统通知数据', $result);
}

View File

@ -78,10 +78,8 @@ class Upgrade extends Controller
{
if ($this->request->isGet()) {
$this->prizes = RebateService::PRIZES;
$vo['number'] = $vo['number'] ?? $this->app->db->name($this->table)->max('number') + 1;
$vo['rebate_rule'] = str2arr($vo['rebate_rule'] ?? '');
if (empty($vo['number'])) {
$vo['number'] = $this->app->db->name($this->table)->max('number') + 1;
}
} else {
$vo['utime'] = time();
$vo['rebate_rule'] = arr2str($vo['rebate_rule'] ?? []);
@ -99,7 +97,7 @@ class Upgrade extends Controller
// 检查升级条件配置
$count = 0;
foreach ($vo as $k => $v) if (is_numeric(stripos($k, '_status'))) $count += $v;
if (empty($count)) $this->error('升级条件不能为空!');
if (empty($count) && $vo['number'] > 0) $this->error('升级条件不能为空!');
}
}
@ -112,9 +110,9 @@ class Upgrade extends Controller
{
if ($state) {
$order = 'number asc,utime desc';
if (input('old_number', 100) < input('number', '0')) $order = 'number asc,utime asc';
if (input('old_number', 100) <= input('number', 0)) $order = 'number asc,utime asc';
foreach ($this->app->db->name($this->table)->order($order)->cursor() as $k => $vo) {
$this->app->db->name($this->table)->where(['id' => $vo['id']])->update(['number' => $k + 1]);
$this->app->db->name($this->table)->where(['id' => $vo['id']])->update(['number' => $k]);
}
}
}

View File

@ -7,7 +7,7 @@
<div class="layui-col-xs3 block relative">
<span class="color-green label-required-prev">等级序号</span><span class="margin-left-5 color-desc">Number</span>
<select class="layui-select" name="number">
{for start="1" end="10" name="i"}{if isset($vo.number) and $vo.number eq $i}
{for start="0" end="10" name="i"}{if isset($vo.number) and $vo.number eq $i}
<option selected value="{$i}">当前 VIP {$vo.number} 等级</option>
{else}
<option value="{$i}">设置 VIP {$i} 等级</option>
@ -111,8 +111,8 @@
</fieldset>
<div class="hr-line-dashed"></div>
{notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}
{notempty name='vo.number'}<input name='old_number' type='hidden' value='{$vo.number}'>{/notempty}
{if isset($vo.id)}<input name='id' type='hidden' value='{$vo.id}'>{/if}
{if isset($vo.number)}<input name='old_number' type='hidden' value='{$vo.number}'>{/if}
<div class="layui-form-item text-center">
<button class="layui-btn" type='submit'>保存数据</button>

View File

@ -345,7 +345,13 @@
$rootScope.specs = angular.fromJson(angular.element('#GoodsSpecs').val() || '[{"name":"默认分组","list":[{"name":"默认规格","check":true}]}]');
/*! 批量设置数值 */
$rootScope.batchSet = function (name, fixed) {
layer.prompt({title: '请输入数值', formType: 0}, function (value, index) {
layer.prompt({
title: '请输入数量【 取值范围1 - 999999 】',
formType: 0, value: (1).toFixed(fixed), success: function ($fn) {
var min = (1).toFixed(fixed), max = (999999).toFixed(fixed);
$fn.find('.layui-layer-input').attr({'data-value-min': min, 'data-value-max': max, 'data-blur-number': fixed});
}
}, function (value, index) {
layer.close(index), $rootScope.$apply(function () {
if (fixed !== null) value = (parseFloat(value) || 0).toFixed(fixed);
$rootScope.items.forEach(function (rows) {

View File

@ -89,7 +89,11 @@
<script>
$('[data-batchset]').on('click', function () {
layer.prompt({title: '请输入库存数值', formType: 0}, function (value, index) {
layer.prompt({
title: '请输入库存数量【 取值范围1 - 999999 】', formType: 0, value: 1, success: function ($fn) {
$fn.find('.layui-layer-input').attr({'data-value-min': 1, 'data-value-max': 999999, 'data-blur-number': 0});
}
}, function (value, index) {
layer.close(index), $('[name^="goods_stock"]').val(parseInt(value) || 0);
});
});

View File

@ -39,7 +39,7 @@
<label class="layui-form-item relative block">
<span class="color-green font-w7">充值账户余额</span>
<span class="color-desc margin-left-5">Amount</span>
<input class="layui-input" data-blur-number="2" maxlength="10" name="amount" placeholder="请输入充值账户余额" required value="{$vo.amount|default='0.00'}">
<input class="layui-input" data-blur-number="2" data-value-max="999999999.99" maxlength="12" name="amount" placeholder="请输入充值账户余额" required value="{$vo.amount|default='0.00'}">
<span class="help-block">请输入要充值的金额,充值后可以使用此余额购买商品</span>
</label>
@ -54,7 +54,7 @@
<option value="{$upgrade.number|default=0}">升级到 [ {$upgrade.number|default='0'} ] {$upgrade.name|default=''}</option>
{/if}{/foreach}
</select>
<span class="help-block">请选择目标升级等级,当用户等级少于当前等级时会进行用户升级操作</span>
<span class="help-block">请选择目标升级等级,当用户于当前等级时会进行用户升级操作</span>
</div>
<div class="layui-form-item relative block">

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php
// This file is automatically generated at:2021-03-27 15:02:52
// This file is automatically generated at:2021-03-29 10:03:48
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',