提交 00f730b9 编写于 作者: D devil_gong

Merge branch 'master' into v1.4.0

......@@ -55,6 +55,9 @@ class GoodsCategory extends Common
// 是否
$this->assign('common_is_text_list', lang('common_is_text_list'));
// 商品分类
$this->assign('goods_category_list', GoodsService::GoodsCategory());
// 编辑器文件存放地址
$this->assign('editor_path_type', 'goods_category');
......
......@@ -19,6 +19,28 @@
<div class="am-popup-bd">
<!-- form start -->
<form class="am-form form-validation admin-save" action="{{:MyUrl('admin/goodscategory/save')}}" method="POST" request-type="ajax-reload" request-value="">
<div class="am-form-group">
<label class="block">父级</label>
<select name="pid" class="am-radius c-p chosen-select forth-selection-form-category" data-placeholder="可选择..." data-validation-message="请选择商品分类">
<option value="0">可选择...</option>
{{if !empty($goods_category_list)}}
{{foreach $goods_category_list as $v}}
<option value="{{$v.id}}">一级 - {{$v.name}}</option>
{{if !empty($v['items'])}}
{{foreach $v.items as $vs}}
<option style="padding-left: 30px;" value="{{$vs.id}}">二级 - {{$vs.name}}</option>
{{if !empty($vs['items'])}}
{{foreach $vs.items as $vss}}
<option style="padding-left: 60px;" value="{{$vss.id}}">三级 - {{$vss.name}}</option>
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
{{/foreach}}
{{/if}}
</select>
</div>
<div class="am-form-group am-form-file">
<label class="block">icon图标</label>
<ul class="plug-file-upload-view goods-category-icon-images-view" data-form-name="icon" data-max-number="1" data-dialog-type="images">
......@@ -77,7 +99,6 @@
{{include file="lib/enable" /}}
<div class="am-form-group am-form-group-refreshing">
<input type="hidden" name="id" />
<input type="hidden" name="pid" value="0" />
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'处理中...'}">保存</button>
</div>
</form>
......
......@@ -777,10 +777,10 @@ class BuyService
'original_price' => $v['original_price'],
'price' => $v['price'],
'spec' => empty($v['spec']) ? '' : json_encode($v['spec']),
'spec_weight' => $v['spec_weight'],
'spec_coding' => $v['spec_coding'],
'spec_barcode' => $v['spec_barcode'],
'buy_number' => $v['stock'],
'spec_weight' => empty($v['spec_weight']) ? 0.00 : (float) $v['spec_weight'],
'spec_coding' => empty($v['spec_coding']) ? '' : $v['spec_coding'],
'spec_barcode' => empty($v['spec_barcode']) ? '' : $v['spec_barcode'],
'buy_number' => intval($v['stock']),
'add_time' => time(),
];
if(Db::name('OrderDetail')->insertGetId($detail) <= 0)
......
......@@ -2047,6 +2047,12 @@ class GoodsService
'big_images' => $attachment['data']['big_images'],
];
// 父级id宇当前id不能相同
if(!empty($params['id']) && $params['id'] == $data['pid'])
{
return DataReturn('父级不能与当前相同', -10);
}
// 添加
if(empty($params['id']))
{
......
......@@ -114,7 +114,7 @@ class OrderService
'total_price' => $order['total_price'],
'notify_url' => $url.'_notify.php',
'call_back_url' => $call_back_url,
'site_name' => MyC('home_seo_site_title', 'ShopXO', true),
'site_name' => MyC('home_site_name', 'ShopXO', true),
);
$pay_name = 'payment\\'.$payment[0]['payment'];
$ret = (new $pay_name($payment[0]['config']))->Pay($pay_data);
......
......@@ -905,6 +905,11 @@ php;
// 开始解压文件
$resource = zip_open($_FILES['file']['tmp_name']);
if(!is_resource($resource))
{
return DataReturn('压缩包打开失败['.$resource.']', -10);
}
while(($temp_resource = zip_read($resource)) !== false)
{
if(zip_entry_open($resource, $temp_resource))
......
此差异已折叠。
......@@ -470,6 +470,16 @@ function FormDataFill(json, tag)
});
}
// 是否存在pid和当前id相同
if($form.find('select[name="pid"]').length > 0)
{
$form.find('select[name="pid"]').find('option').removeAttr('disabled');
if((json['id'] || null) != null)
{
$form.find('select[name="pid"]').find('option[value="'+json['id']+'"]').attr('disabled', true);
}
}
// 多选插件事件更新
if($('.chosen-select').length > 0)
{
......@@ -1378,7 +1388,13 @@ $(function()
// 父节点赋值
var id = parseInt($(this).data('id')) || 0;
$('#data-save-win').find('input[name="pid"]').val(id);
$('#data-save-win').find('input[name="pid"], select[name="pid"]').val(id);
// 多选插件事件更新
if($('.chosen-select').length > 0)
{
$('.chosen-select').trigger('chosen:updated');
}
});
/**
......@@ -1461,6 +1477,12 @@ $(function()
{
$(this).blur();
});
// 多选插件事件更新
if($('.chosen-select').length > 0)
{
$('.chosen-select').trigger('chosen:updated');
}
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册