feat: #10000 优化无需同步的商品

This commit is contained in:
赵世界 2022-11-01 14:15:57 +08:00
parent 998f369034
commit a048a11cba
2 changed files with 6 additions and 3 deletions

View File

@ -172,8 +172,6 @@ class ShopsController extends Controller
public function downloadGoods($id, Request $request)
{
$shop = Shop::query()->find($id);
// 删除已下载的商品数据
BusinessGoodsSku::query()->where('shop_id', $shop->id)->delete();
$business = BusinessFactory::init()->make($shop->plat_id);
$business->setShop($shop);
$business->downloadGoodsListAndBind();

View File

@ -123,7 +123,12 @@ class KuaiTuanTuan extends BusinessClient
$publicParams['sign'] = $this->getSign($publicParams);
$res = $this->formDataPostRequest($url, $publicParams);
if (isset($res['error_response'])) {
Log::info(json_encode($res, 256));
// "error_msg":"业务服务错误","sub_msg":"该店铺下不存在该商品","sub_code":"11","error_code":50001
// "error_msg":"业务服务错误","sub_msg":"该SKU在快团团中设置的库存为无限库存不支持修改库存","sub_code":"13","error_code":50001
if (50001 == $res['error_response']['error_code'] && in_array($res['error_response']['sub_code'], ['13', '11'])) {
BusinessGoodsSku::query()->where('goods_id', $appendParams['goods_id'])->where('sku_id', $appendParams['sku_id'])->update(['is_sync' => 0]);
}
Log::error(json_encode($res, 256));
}
return $res;