修改
This commit is contained in:
parent
1b34f10387
commit
70fa4c5432
|
|
@ -471,15 +471,14 @@ class Cardextractor extends Base
|
|||
public function card_shang(Request $request)
|
||||
{
|
||||
$goods_id = request()->param('goods_id/d', 0);
|
||||
if ($goods_id <= 0) {
|
||||
return $this->renderError("非法请求");
|
||||
}
|
||||
// if ($goods_id <= 0) {
|
||||
// return $this->renderError("非法请求");
|
||||
// }
|
||||
$goods = GoodsModel::where(['id' => $goods_id])->find();
|
||||
if (!$goods) {
|
||||
return $this->renderError("请求参数错误");
|
||||
}
|
||||
$data = Shang::where('goods_id', '=', $goods_id)
|
||||
->order('sort desc,id asc')
|
||||
// if (!$goods) {
|
||||
// return $this->renderError("请求参数错误");
|
||||
// }
|
||||
$data = Shang::where('id','<',39) ->order('sort desc,id asc')
|
||||
->select()->toArray();
|
||||
#概率
|
||||
$pro = array_sum(array_column($data, 'pro'));
|
||||
|
|
@ -568,9 +567,9 @@ class Cardextractor extends Base
|
|||
if (RegZero($data['sort'])) {
|
||||
return $this->renderError("排序输入不规范,请输入整数");
|
||||
}
|
||||
if (empty($data['imgurl'])) {
|
||||
return $this->renderError("请上传等级图标");
|
||||
}
|
||||
// if (empty($data['imgurl'])) {
|
||||
// return $this->renderError("请上传等级图标");
|
||||
// }
|
||||
$data['update_time'] = time();
|
||||
Db::startTrans();
|
||||
$res[] = $info->allowField([])->update($data);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<div class="layui-card-body">
|
||||
<xblock>
|
||||
<div style="padding-bottom: 10px;">
|
||||
<a class="layui-btn" onclick="card_shang_add({$goods_id})">添加等级</a>
|
||||
<!-- <a class="layui-btn" onclick="card_shang_add({$goods_id})">添加等级</a> -->
|
||||
<span style="line-height:40px;float:right;">共有数据: {$count}条</span>
|
||||
</div>
|
||||
</xblock>
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<th>等级名称</th>
|
||||
<th>等级图标</th>
|
||||
<th>发光特效</th>
|
||||
<th>颜色</th>
|
||||
<th>等级概率({$pro}%)</th>
|
||||
<th>排序</th>
|
||||
<th>操作</th>
|
||||
|
|
@ -26,15 +27,16 @@
|
|||
<td>{$vo['title']}</td>
|
||||
<td>{if $vo['imgurl']}<img src="{:imageUrl($vo['imgurl'])}" style="width:50px;height:30px;">{/if}</td>
|
||||
<td>{if $vo['special_imgurl']}<img src="{PHP} echo imageUrl($vo['special_imgurl']){/php}" style="width:60px;height:60px;">{/if}</td>
|
||||
<td>{$vo['color']}</td>
|
||||
<td>{$vo['pro']*1}%</td>
|
||||
<td>{$vo['sort']}</td>
|
||||
<td>
|
||||
<a style="text-decoration:none" onclick="card_shang_edit({$vo.id})" class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">
|
||||
<i class="layui-icon layui-icon-edit"></i>编辑
|
||||
</a>
|
||||
<a style="text-decoration:none" onclick="card_goodslist({$vo['id']},'{$vo.title}')" class="layui-btn layui-btn-warm layui-btn-xs">等级奖品</a>
|
||||
<a style="text-decoration:none" onClick="card_shang_del({$vo.id},'删除')" class="layui-btn layui-btn-danger layui-btn-xs">
|
||||
<i class="layui-icon layui-icon-delete"></i>删除
|
||||
<!-- <a style="text-decoration:none" onclick="card_goodslist({$vo['id']},'{$vo.title}')" class="layui-btn layui-btn-warm layui-btn-xs">等级奖品</a> -->
|
||||
<!-- <a style="text-decoration:none" onClick="card_shang_del({$vo.id},'删除')" class="layui-btn layui-btn-danger layui-btn-xs"> -->
|
||||
<!-- <i class="layui-icon layui-icon-delete"></i>删除 -->
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
<input type="text" name="pro" value="{$info.pro*1}" autocomplete="off" placeholder="请输入卡等级概率" class="layui-input" style="width: 200px;display: inline-block">%
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">颜色设置</label>
|
||||
<div class="layui-input-inline" style="width: 230px">
|
||||
<input type="text" name="color" value="{$info.color}" autocomplete="off" placeholder="请输入颜色" class="layui-input" style="width: 200px;display: inline-block">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">卡等级排序</label>
|
||||
<div class="layui-input-inline">
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ return [
|
|||
'store' => null,
|
||||
// 前缀
|
||||
'prefix' => '',
|
||||
'expire' => 3600,
|
||||
'expire' => 36000,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -215,7 +215,10 @@ return [
|
|||
'url' => '/admin/sign',
|
||||
'name' => '签到设置',
|
||||
],
|
||||
|
||||
[
|
||||
'url' => '/admin/card_shang',
|
||||
'name' => '抽奖等级设置',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user