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
843d0ae1
authored
May 06, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
c50c7213
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
app/Http/Controllers/Api/SkuApiController.php
resources/views/script/SkuListScript.blade.php
app/Http/Controllers/Api/SkuApiController.php
View file @
843d0ae1
...
@@ -34,10 +34,16 @@ class SkuApiController extends Controller
...
@@ -34,10 +34,16 @@ class SkuApiController extends Controller
$this
->
response
(
-
1
,
'请选择要操作的SKU'
,
'0'
);
$this
->
response
(
-
1
,
'请选择要操作的SKU'
,
'0'
);
}
}
$status
=
$request
->
input
(
'status'
);
$status
=
$request
->
input
(
'status'
);
$result
=
curl
(
env
(
'FOOTSTONE_URL'
)
.
'/fsapi/operation_sku_status'
,
[
$userId
=
$request
->
cookie
(
'oa_user_id'
);
$sKey
=
$request
->
cookie
(
'oa_skey'
);
$cookie
=
'oa_user_id='
.
$userId
.
'; oa_skey='
.
$sKey
;
$url
=
env
(
'FOOTSTONE_URL'
)
.
'/fsapi/operation_sku_status'
;
$params
=
[
'goods_id'
=>
$map
,
'goods_id'
=>
$map
,
'status'
=>
$status
'status'
=>
$status
]);
];
$params
=
http_build_query
(
$params
);
$result
=
curl
(
$url
,
$params
,
true
,
false
,
$cookie
);
$result
=
json_decode
(
$result
,
true
);
$result
=
json_decode
(
$result
,
true
);
if
(
$result
[
'errcode'
]
==
0
)
{
if
(
$result
[
'errcode'
]
==
0
)
{
$this
->
response
(
0
,
'操作成功'
);
$this
->
response
(
0
,
'操作成功'
);
...
@@ -51,7 +57,7 @@ class SkuApiController extends Controller
...
@@ -51,7 +57,7 @@ class SkuApiController extends Controller
{
{
$supplierCode
=
$request
->
get
(
'supplier_code'
);
$supplierCode
=
$request
->
get
(
'supplier_code'
);
$brandId
=
$request
->
get
(
'brand_ids'
);
$brandId
=
$request
->
get
(
'brand_ids'
);
$brandId
=
str_replace
(
','
,
''
,
$brandId
);
$brandId
=
str_replace
(
','
,
''
,
$brandId
);
$updateTime
=
$request
->
get
(
'update_time'
);
$updateTime
=
$request
->
get
(
'update_time'
);
if
(
empty
(
$supplierCode
))
{
if
(
empty
(
$supplierCode
))
{
$this
->
response
(
-
1
,
'请选择供应商'
);
$this
->
response
(
-
1
,
'请选择供应商'
);
...
@@ -59,22 +65,26 @@ class SkuApiController extends Controller
...
@@ -59,22 +65,26 @@ class SkuApiController extends Controller
$startTime
=
$endTime
=
0
;
$startTime
=
$endTime
=
0
;
if
(
$updateTime
)
{
if
(
$updateTime
)
{
$updateTime
=
explode
(
'~'
,
$updateTime
);
$updateTime
=
explode
(
'~'
,
$updateTime
);
$startTime
=
strtotime
(
$updateTime
[
0
])
;
$startTime
=
$updateTime
[
0
]
;
$endTime
=
strtotime
(
$updateTime
[
1
])
;
$endTime
=
$updateTime
[
1
]
;
}
}
$map
=
[
$map
=
[
'supplier_code'
=>
$supplierCode
,
'supplier_code'
=>
$supplierCode
,
'brand_id'
=>
$brandId
,
'brand_id'
=>
$brandId
,
'start_time'
=>
$startTime
,
'start_time'
=>
$startTime
,
'end_time'
=>
$endTime
,
'end_time'
=>
$endTime
,
];
];
$url
=
''
;
$url
=
env
(
'FOOTSTONE_URL'
)
.
'/uploadSkuApi/batchOffShelf'
;
$result
=
curl
(
$url
,
$map
);
$userId
=
$request
->
cookie
(
'oa_user_id'
);
$sKey
=
$request
->
cookie
(
'oa_skey'
);
$cookie
=
'oa_user_id='
.
$userId
.
'; oa_skey='
.
$sKey
;
$result
=
curl
(
$url
,
$map
,
true
,
false
,
$cookie
);
dd
(
$result
);
$result
=
json_decode
(
$result
,
true
);
$result
=
json_decode
(
$result
,
true
);
if
(
isset
(
$result
[
'err_code'
])
&&
$result
[
'err_code'
]
===
0
)
{
if
(
isset
(
$result
[
'err_code'
])
&&
$result
[
'err_code'
]
===
0
)
{
$this
->
response
(
0
,
'批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
$this
->
response
(
0
,
'批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况'
);
}
else
{
}
else
{
$this
->
response
(
-
1
,
'批量下架失败'
);
$this
->
response
(
-
1
,
'批量下架失败'
);
}
}
}
}
...
...
resources/views/script/SkuListScript.blade.php
View file @
843d0ae1
...
@@ -188,7 +188,7 @@
...
@@ -188,7 +188,7 @@
//批量上下架操作
//批量上下架操作
function
batchUpdateGoodsStatus
(
skuId
,
status
)
{
function
batchUpdateGoodsStatus
(
skuId
,
status
)
{
let
statusName
=
status
===
'offshelf'
?
'下架'
:
'上架'
;
let
statusName
=
status
===
'offshelf'
?
'下架'
:
'上架'
;
top
.
layer
.
confirm
(
'确定要'
+
statusName
+
"商品
"
,
function
(
index
)
{
layer
.
confirm
(
'确定要'
+
statusName
+
"选中的这些商品吗
"
,
function
(
index
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'post'
,
type
:
'post'
,
url
:
'/api/sku/UpdateSkuStatus'
,
url
:
'/api/sku/UpdateSkuStatus'
,
...
@@ -216,7 +216,7 @@
...
@@ -216,7 +216,7 @@
}
}
}
}
});
});
top
.
layer
.
closeAll
();
layer
.
closeAll
();
});
});
}
}
...
...
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