select(['id', 'cloud_goods_id'])->where([ 'store_id' => $this->store_id, 'is_delete' => 0, 'is_wholesale' => 0 ])->andWhere('cloud_goods_id > 0')->asArray()->all(); foreach ($goods_list as $goods) { try { $model = new GoodsForm(); $model->id = $goods['cloud_goods_id']; $model->store_id = $this->store_id; $model->saveCloudGoods(); } catch (\Throwable $e) { debug_log('同步云仓商品价格失败,商品ID:' . $goods['id'] . ',错误信息:' . $e->getMessage(), 'SyncCloudGoodsPriceJob.log'); continue; } } } }