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
13046fa5
authored
Apr 29, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
temp
parent
427fcb6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
33 deletions
app/Http/Controllers/Api/SkuApiController.php
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Controllers/Api/SkuApiController.php
View file @
13046fa5
...
@@ -34,39 +34,15 @@ class SkuApiController extends Controller
...
@@ -34,39 +34,15 @@ class SkuApiController extends Controller
$this
->
response
(
-
1
,
'请选择要操作的SKU'
,
'0'
);
$this
->
response
(
-
1
,
'请选择要操作的SKU'
,
'0'
);
}
}
$status
=
$request
->
input
(
'status'
);
$status
=
$request
->
input
(
'status'
);
$Redis
=
new
RedisModel
();
$result
=
curl
(
env
(
'FOOTSTONE_URL'
)
.
'/fsapi/operation_sku_status'
,
[
$updateData
[
'update_time'
]
=
time
();
'goods_id'
=>
$map
,
switch
(
$status
)
{
'status'
=>
$status
case
'offshelf'
:
]);
$updateData
[
'goods_status'
]
=
3
;
$result
=
json_decode
(
$result
,
true
);
$msg
=
'成功下架'
;
if
(
$result
[
'errcode'
]
==
0
)
{
break
;
$this
->
response
(
0
,
'操作成功'
);
case
'passed'
:
}
else
{
$msg
=
'成功上架'
;
$this
->
response
(
-
1
,
'操作失败,原因是 : '
.
$result
[
'errmsg'
]);
$updateData
[
'goods_status'
]
=
1
;
break
;
case
'negative'
:
$updateData
[
'goods_status'
]
=
2
;
$msg
=
'审核不通过'
;
break
;
}
}
$skuService
=
new
SkuService
();
$i
=
0
;
foreach
(
$map
as
$k
=>
$v
)
{
$dbinfo
=
resolve
(
$v
);
$list
=
DB
::
connection
(
$dbinfo
[
'db'
])
->
table
(
$dbinfo
[
'table'
])
->
where
(
'goods_id'
,
$v
)
->
update
(
$updateData
);
if
(
$list
)
{
$info
=
json_decode
(
$Redis
->
hget
(
'sku'
,
$v
),
true
);
$info
[
'goods_status'
]
=
$updateData
[
'goods_status'
];
$info
[
'goods_id'
]
=
$v
;
$info
[
'update_time'
]
=
$updateData
[
'update_time'
];
$skuService
->
HandleSku
(
$info
);
$i
++
;
}
}
//实时推送ES
$skuIds
=
implode
(
','
,
$map
);
$skuService
->
PushSkuUpdate
(
$skuIds
);
$this
->
response
(
0
,
'操作成功'
);
}
}
}
}
app/Http/Controllers/Api/SupplierApiController.php
View file @
13046fa5
...
@@ -297,4 +297,5 @@ class SupplierApiController extends Controller
...
@@ -297,4 +297,5 @@ class SupplierApiController extends Controller
}
}
$this
->
response
(
0
,
'转正供应商成功'
);
$this
->
response
(
0
,
'转正供应商成功'
);
}
}
}
}
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