Commit 843d0ae1 by mushishixian

temp

parent c50c7213
......@@ -34,10 +34,16 @@ class SkuApiController extends Controller
$this->response(-1, '请选择要操作的SKU', '0');
}
$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,
'status' => $status
]);
];
$params = http_build_query($params);
$result = curl($url, $params, true, false, $cookie);
$result = json_decode($result, true);
if ($result['errcode'] == 0) {
$this->response(0, '操作成功');
......@@ -51,7 +57,7 @@ class SkuApiController extends Controller
{
$supplierCode = $request->get('supplier_code');
$brandId = $request->get('brand_ids');
$brandId = str_replace( ',', '',$brandId);
$brandId = str_replace(',', '', $brandId);
$updateTime = $request->get('update_time');
if (empty($supplierCode)) {
$this->response(-1, '请选择供应商');
......@@ -59,22 +65,26 @@ class SkuApiController extends Controller
$startTime = $endTime = 0;
if ($updateTime) {
$updateTime = explode('~', $updateTime);
$startTime = strtotime($updateTime[0]);
$endTime = strtotime($updateTime[1]);
$startTime = $updateTime[0];
$endTime = $updateTime[1];
}
$map = [
'supplier_code'=>$supplierCode,
'brand_id'=>$brandId,
'supplier_code' => $supplierCode,
'brand_id' => $brandId,
'start_time' => $startTime,
'end_time' => $endTime,
];
$url = '';
$result = curl($url,$map);
$url = env('FOOTSTONE_URL') . '/uploadSkuApi/batchOffShelf';
$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);
if (isset($result['err_code']) && $result['err_code'] === 0) {
$this->response(0, '批量下架任务已经发送,请等待任务完成,期间你可以刷新列表查看下架情况');
}else{
} else {
$this->response(-1, '批量下架失败');
}
}
......
......@@ -188,7 +188,7 @@
//批量上下架操作
function batchUpdateGoodsStatus(skuId, status) {
let statusName = status === 'offshelf' ? '下架' : '上架';
top.layer.confirm('确定要' + statusName + "商品", function (index) {
layer.confirm('确定要' + statusName + "选中的这些商品吗", function (index) {
$.ajax({
type: 'post',
url: '/api/sku/UpdateSkuStatus',
......@@ -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