>' . $this->orderId); $this->setRequest(); $order = Order::findOne([ 'id' => $this->orderId, 'is_delete' => 0, 'is_send' => 1, 'is_confirm' => 0 ]); if (!$order) { return true; } $mall = Mall::findOne(['id' => $order->mall_id]); \Yii::$app->setMall($mall); if ($order->pay_type == 2) { \Yii::error('货到付款的无法自动收货'); return true; } // TODO 订单处于售后状态是未处理 $order->is_confirm = 1; $order->confirm_time = mysql_timestamp(); if ($order->save()) { $event = new OrderEvent([ 'order' => $order, ]); \Yii::$app->trigger(Order::EVENT_CONFIRMED, $event); } } }