Commit 843d0ae1 by mushishixian

temp

parent c50c7213
...@@ -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, '批量下架失败');
} }
} }
......
...@@ -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();
}); });
} }
......
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