['shansong', 'fengniao', 'huolala', 'dada']], ]; } public function attributeLabels() { return [ 'ghsOrderId' => '批发订单ID', 'platform' => '配送平台', ]; } /** * 验证批发订单ID * @param $attribute */ public function validateGhsOrderId($attribute) { if (!$this->hasErrors()) { $gdo = GhsDeliveryOrderClass::getByCondition( ['mainId' => Yii::$app->controller->mainId, 'ghsOrderId' => $this->ghsOrderId, 'orderStatus' => ['not in', [-1, -2]]], false ); if (empty($gdo)) { $this->addError($attribute, '未找到对应的配送订单'); } } } }