Commit 99ce32cc by 杨树贤

标签获取方式兼容华云

parent aaea7066
......@@ -180,8 +180,9 @@ class SkuApiController extends Controller
//获取所有系统标签
public function GetSystemTagList($request)
{
$orgId = $request->input('org_id');
$skuService = new SkuService();
$data = $skuService->getSystemTags();
$data = $skuService->getSystemTags($orgId);
$this->response(0, 'ok', $data, count($data));
}
......
......@@ -85,9 +85,9 @@ class SkuService
}
}
}
$standardBrandId = array_get($spu,'s_brand_id');
$standardBrandId = array_get($spu, 's_brand_id');
if ($standardBrandId) {
$standardBrand = $redis->hget('standard_brand',$standardBrandId);
$standardBrand = $redis->hget('standard_brand', $standardBrandId);
$standardBrand = json_decode($standardBrand, true);
$sku['standard_brand_name'] = $standardBrand['brand_name'];
}
......@@ -338,9 +338,10 @@ class SkuService
return $result;
}
public function getSystemTags()
public function getSystemTags($orgId = 1)
{
$tags = TagsModel::where('tag_use', 16)->where('tag_type', 2)->where('status', TagsModel::STATUS_OK)
->where('org_id', $orgId)
->pluck('tag_name', 'tag_name')->toArray();
$result = [];
foreach ($tags as $key => $value) {
......
......@@ -43,7 +43,7 @@
function getTagOption(element) {
//获取系统标签列表
let url = '/api/sku/GetSystemTagList';
let url = '/api/sku/GetSystemTagList?org_id=' + getQueryVariable('org_id');
let tagResult = ajax(url);
let tagList = tagResult.data;
return {
......@@ -75,4 +75,4 @@
let systemTagOption = getTagOption('sku_tags_selector', 2);
let tagSelector = xmSelect.render(systemTagOption);
});
</script>
\ No newline at end of file
</script>
......@@ -119,4 +119,4 @@
$(this).parents('tr').remove();
});
});
</script>
\ No newline at end of file
</script>
......@@ -434,10 +434,20 @@
let checkStatus = table.checkStatus('skuList');
let data = checkStatus.data;
let skuIds = Array.from(data, ({goods_id}) => goods_id);
if (skuIds.length === 0) {
parent.layer.msg('请选择要操作的sku', {icon: 5});
return false;
}
let orgIds = Array.from(data, ({org_id}) => org_id);
orgIds = [...new Set(orgIds)]
if (orgIds.length > 1) {
parent.layer.msg('只能操作相同组织的sku', {icon: 5});
return false;
}
skuIds = skuIds.join(',');
layer.open({
type: 2,
content: '/sku/BatchAddSkuTag?view=iframe&sku_ids=' + skuIds,
content: '/sku/BatchAddSkuTag?view=iframe&sku_ids=' + skuIds + '&org_id=' + orgIds[0],
area: ['800px', '600px'],
title: '批量设置SKU标签',
end: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment