0, 'delete_time' => 0]; $InvoiceIssuanceData = (new InvoiceIssuanceModel())->where($where)->page(1, $limit)->select(); foreach ($InvoiceIssuanceData as $InvoiceIssuanceValue) { (new InvoiceIssuanceService())->IssueAnInvoice($InvoiceIssuanceValue); } return $this->buildSuccess(); } /** * 开票失败 修改为虚拟 继续发起 * @return \think\Response * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function runCancelInitiateAgain() { $limit = 100; $where = ['status' => 1, 'delete_time' => 0]; $InvoiceIssuanceData = (new InvoiceIssuanceModel())->where($where)->page(1, $limit)->select(); foreach ($InvoiceIssuanceData as $InvoiceIssuanceValue) { (new InvoiceIssuanceService())->cancelInitiateAgain($InvoiceIssuanceValue); } return $this->buildSuccess(); } }