setDescription('获取处方平台商品库存数据'); } public function handle() { $this->line("商品库存更新开始"); try { // 获取商品 $params = array(); $product = Product::getPage($params); if (empty($product['data'])){ $this->line("商品库存更新成功,无可更新库存商品"); return; } $prescription = new Prescription(); foreach ($product['data'] as $item){ if (!empty($item['product_pharmacy_code'])){ } $result = $prescription->getProdStock($item['product_pharmacy_code']); dump($result);die; } } catch (\Exception $e) { $this->line("商品库存更新失败:" . $e->getMessage()); } $this->line("商品库存更新成功"); } }