| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace common\models\user;
- use common\models\base\BaseActiveRecord;
- use Yii;
- /**
- * This is the model class for table "qimall_user_del_log".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $user_id
- * @property string $new_mobile
- * @property string $old_mobile
- * @property int $status
- * @property int|null $created_at 添加时间戳
- * @property int|null $updated_at 更新时间戳
- */
- class UserDelLog extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%user_del_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'new_mobile', 'old_mobile'], 'required'],
- [['mall_id', 'user_id', 'status', 'created_at', 'updated_at', 'is_recovered', 'recover_time'], 'integer'],
- [['new_mobile', 'old_mobile'], 'string', 'max' => 20],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'new_mobile' => 'New Mobile',
- 'old_mobile' => 'Old Mobile',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- public static function setData(array $params)
- {
- try {
- $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;
- }
- }
- }
|