Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
99ce32cc
authored
Apr 30, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
标签获取方式兼容华云
parent
aaea7066
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
10 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Services/SkuService.php
resources/views/script/BatchAddSkuTagScript.blade.php
resources/views/script/BatchAddTagScript.blade.php
resources/views/script/SkuListScript.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
99ce32cc
...
...
@@ -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
));
}
...
...
app/Http/Services/SkuService.php
View file @
99ce32cc
...
...
@@ -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
)
{
...
...
resources/views/script/BatchAddSkuTagScript.blade.php
View file @
99ce32cc
...
...
@@ -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>
resources/views/script/BatchAddTagScript.blade.php
View file @
99ce32cc
...
...
@@ -119,4 +119,4 @@
$
(
this
).
parents
(
'tr'
).
remove
();
});
});
</script>
\ No newline at end of file
</script>
resources/views/script/SkuListScript.blade.php
View file @
99ce32cc
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment