taskExpire = 30; } ['storeId' => $this->storeId] = $param; $this->setInterval($this->storeId, $this->taskKey, $this->taskExpire, function () { // echo $this->taskKey . PHP_EOL; // 批量操作超时未退货的售后单 $this->deliveryEvent(); }); } /** * 已同意退货退款售后单自动超时关闭售后单 * 超过7天用户未退货,售后申请自动关闭,修改成超时未发货状态 */ private function deliveryEvent() { $commentDays = 7; if ($commentDays > 0) { $service = new OrderRefundService; $service->deliveryEvent($this->storeId, $commentDays); } } }