| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace addons\ScoreExpansion\common\models;
- use common\enums\StatusEnum;
- use Exception;
- use RuntimeException;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_score_expansion_invert_log".
- *
- * @property int $id
- * @property int $mall_id 商城ID
- * @property string $addons_name 插件(哪个插件奖励的积分被转化)
- * @property string $source_table 来源表
- * @property int $source_table_id 来源ID
- * @property int $score_log_id 来源ID
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at
- * @property int $updated_at
- */
- class ScoreExpansionInvertLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return 'qimall_addons_score_expansion_invert_log';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'source_table_id', 'score_log_id', 'status', 'created_at', 'updated_at'], 'integer'],
- [['addons_name', 'source_table'], 'string', 'max' => 100],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'addons_name' => 'Addons Name',
- 'source_table' => 'Source Table',
- 'source_table_id' => 'Source Table ID',
- 'score_log_id' => 'Score Log Id',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- /**
- * @param array $params
- *
- * @return bool|self
- */
- public static function setData(array $params)
- {
- try {
- $model = new static();
- $model->loadDefaultValues();
- if (!$model->load($params, '')) {
- throw new RuntimeException($model->getErrorMessage());
- }
- if (!$model->save()) {
- throw new RuntimeException($model->getErrorMessage());
- }
- return $model;
- } catch (Exception $e) {
- static::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|