255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'order_id' => 'Order ID', 'order_no' => 'Order No', 'express_no' => 'Express No', 'express_company' => 'Express Company', 'status' => 'Status', 'get_status' => 'Get Status', 'mall_id' => 'Mall ID', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } public function getGoods() { return $this->hasMany(HappinessVoucherExpressGoods::className(), ['express_id' => 'id']); } public static function setData(array $params) { try { if(isset($params['id']) && !empty($params['id'])) $model = self::findOne($params['id']); else { $model = new self(); $model->loadDefaultValues(); } if(!$model) { $model = new self(); $model->loadDefaultValues(); } if (!$model->load($params, '') || !$model->save()) { throw new \Exception($model->getErrorMessage()); } return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } }