where('is_delete',0) ->where('is_sale',1) ->where('is_pool',1) ->field(['goods_id','is_sale','is_pool']) ->select(); if ($goods_list->isEmpty()) { return true; } $goodsIds = array_column($goods_list->toArray(), "goods_id"); $up_data = [ 'is_sale' => 1, 'is_pool' => 1, 'status' => 10, 'is_jd_remove' => 0, 'update_time' => time(), 'is_delete' => 0 ]; GoodsModel::whereIn('origin_goods_id', $goodsIds)->update($up_data); //上架批发商城总后台的商品 $wholesalePlatformGoodsList = Db::connect("dataCenterMysql")->table('yoshop_goods')->whereIn('origin_goods_id', $goodsIds)->field(['goods_id','is_sale','is_pool'])->select(); if ($wholesalePlatformGoodsList->isEmpty()) { return true; } Db::connect("dataCenterMysql")->table('yoshop_goods')->whereIn('origin_goods_id', $goodsIds)->update($up_data); //上架批发商城-商城端的商品 $wholesalePlatformGoodsIds = array_column($wholesalePlatformGoodsList->toArray(), "goods_id"); Db::connect("dataCenterMysql")->table('yoshop_goods')->whereIn('origin_goods_id', $wholesalePlatformGoodsIds)->update($up_data); return true; } }