mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
feat: #10000 优化无需同步的商品
This commit is contained in:
parent
998f369034
commit
a048a11cba
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user