地图api
This commit is contained in:
@@ -47,6 +47,7 @@ class GoodsCategoryLogic
|
||||
'level' => $level + 1,
|
||||
'is_recommend' => $post['pid'] == 0 ? $is_recommend : 0,
|
||||
'remark' => $post['remark'],
|
||||
'type' => $post['type'], //1:普通分类 2:推荐分类
|
||||
'create_time' => time(),
|
||||
'update_time' => time(),
|
||||
];
|
||||
@@ -77,6 +78,7 @@ class GoodsCategoryLogic
|
||||
'pid' => $post['pid'],
|
||||
'is_recommend' => $post['pid'] == 0 ? $is_recommend : 0,
|
||||
'remark' => $post['remark'],
|
||||
'type' => $post['type'], //1:普通分类 2:推荐分类
|
||||
'update_time' => time(),
|
||||
];
|
||||
|
||||
@@ -128,7 +130,7 @@ class GoodsCategoryLogic
|
||||
$lists = Db::name('goods_category')
|
||||
->where(['del' => 0])
|
||||
->order('id asc')
|
||||
->column('id,name,pid,is_recommend,is_show,level,image,sort');
|
||||
->column('id,name,pid,is_recommend,is_show,level,image,sort,type');
|
||||
foreach ($lists as $k => $item){
|
||||
$lists[$k]['image'] = UrlServer::getFileUrl($item['image']);
|
||||
}
|
||||
|
||||
@@ -481,7 +481,8 @@ class GoodsLogic
|
||||
'give_integral_type' => $give_integral_type,
|
||||
'give_integral' => $give_integral,
|
||||
'spec_type' => $post['spec_type'],
|
||||
'update_time' => $time
|
||||
'update_time' => $time,
|
||||
'type' => $post['type'],
|
||||
];
|
||||
|
||||
Db::name('goods')
|
||||
|
||||
@@ -44,6 +44,7 @@ class Goods extends Validate
|
||||
'region_ratio' => 'lt:100',
|
||||
'shareholder_ratio' => 'lt:100',
|
||||
'give_integral_ratio' => 'egt:0',
|
||||
'type' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@@ -69,6 +70,7 @@ class Goods extends Validate
|
||||
'region_ratio.lt' => '区域分红比例不能超过100',
|
||||
'shareholder_ratio.lt' => '股东分红比例不能超过100',
|
||||
'give_integral_ratio.egt' => '赠送积分比例须大于或等于0',
|
||||
'type.require' => '请选择商品类型',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ class GoodsCategory extends Validate
|
||||
'name' => 'require|checkName',
|
||||
'pid' => 'addPid|editPid',
|
||||
'image' => 'require',
|
||||
'type' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@@ -37,6 +38,7 @@ class GoodsCategory extends Validate
|
||||
'name.require' => '分类名称不能为空!',
|
||||
'name.unique' => '分类名称已存在',
|
||||
'image.require' => '请上传分类图标',
|
||||
'type.require' => '请选择分类类型'
|
||||
];
|
||||
protected function sceneAdd()
|
||||
{
|
||||
|
||||
@@ -30,6 +30,8 @@ class GoodsOneSpec extends Validate
|
||||
'one_stock' => 'require|integer',
|
||||
'one_volume' => 'egt:0',
|
||||
'one_weight' => 'egt:0',
|
||||
'type' => 'require',
|
||||
'points' => 'egt:0',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@@ -45,6 +47,8 @@ class GoodsOneSpec extends Validate
|
||||
'one_cost_price.egt' => '成本价必须大于或等于0.01',
|
||||
'one_stock.require' => '请输入库存',
|
||||
'one_stock.integer' => '库存必须为整型',
|
||||
'type.require' => '请选择规格类型',
|
||||
'points.egt' => '积分必须为正整数',
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>商品类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="服务商品" checked>
|
||||
<input type="radio" name="type" value="2" title="普通商品">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">服务次数:</label>
|
||||
<div class="layui-input-block">
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
<input type="text" name="name" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>商品类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="服务商品" checked>
|
||||
<input type="radio" name="type" value="2" title="普通商品">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">父级分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
<input type="text" name="name" value="{$info.name}" lay-verify="required" lay-verType="tips" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="form-label-asterisk">*</span>商品类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="1" title="服务商品" {if $info.type == 1} checked="checked" {/if}>
|
||||
<input type="radio" name="type" value="2" title="普通商品" {if $info.type == 2} checked="checked" {/if}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">父级分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
@@ -93,6 +93,14 @@
|
||||
},
|
||||
cols: [
|
||||
{field: 'name', title: '分类名称',width: 280},
|
||||
//类型 1服务商品 2普通商品
|
||||
{field: 'type', title: '类型', width: 100, align: 'center',templet: function (d) {
|
||||
if(d.type === 1){
|
||||
return '服务商品';
|
||||
}else{
|
||||
return '普通商品';
|
||||
}
|
||||
}},
|
||||
{field: '#image', title: '分类图标', width: 120,style:'height:100px;',toolbar: '#image', align: 'center'},
|
||||
{templet: '#is_recommend', title: '首页推荐', width: 100,align: 'center'},
|
||||
{templet: '#is_show', title: '显示', width: 100},
|
||||
|
||||
Reference in New Issue
Block a user