255], [['wallet_type', 'reward_type'], 'string', 'max' => 50], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => 'Mall ID', 'source_table' => 'Source Table', 'source_table_id' => 'Source Table ID', 'status' => 'Status', 'wallet_type' => 'Wallet Type', 'change_num' => 'Change Num', 'is_return' => 'Is Refund', 'agent_id' => 'Agent ID', 'user_id' => 'User ID', 'level' => 'Level', 'agent_area' => 'Agent Area', 'reward_type' => 'Reward Type', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @param array $params * * @return bool|self */ public static function setData(array $params) { try { $model = new self(); $model->loadDefaultValues(); if (!$model->load($params, '')) { throw new RuntimeException($model->getErrorMessage()); } if (!$model->save()) { throw new RuntimeException($model->getErrorMessage()); } return $model; } catch (Exception $e) { self::$static_error = $e->getMessage(); return false; } } }