Commit 13046fa5 by mushishixian

temp

parent 427fcb6b
......@@ -34,39 +34,15 @@ class SkuApiController extends Controller
$this->response(-1, '请选择要操作的SKU', '0');
}
$status = $request->input('status');
$Redis = new RedisModel();
$updateData['update_time'] = time();
switch ($status) {
case 'offshelf':
$updateData['goods_status'] = 3;
$msg = '成功下架';
break;
case 'passed':
$msg = '成功上架';
$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);
$result = curl(env('FOOTSTONE_URL') . '/fsapi/operation_sku_status', [
'goods_id' => $map,
'status' => $status
]);
$result = json_decode($result, true);
if ($result['errcode'] == 0) {
$this->response(0, '操作成功');
} else {
$this->response(-1, '操作失败,原因是 : ' . $result['errmsg']);
}
}
}
......@@ -297,4 +297,5 @@ class SupplierApiController extends Controller
}
$this->response(0, '转正供应商成功');
}
}
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