| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace addons\QiJuhe\common\models;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\helpers\Json;
- /**
- * This is the model class for table "{{%addons_juhe_shop_setting}}".
- *
- * @property int $id
- * @property int $mall_id
- * @property string|null $setting
- * @property int|null $created_at
- * @property string $token
- * @property int|null $expire_time
- * @property int|null $updated_at
- * @property int|null $is_delete
- * @property int|null $deleted_at
- */
- class SettingModel extends ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_qijuhe_setting}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id'], 'required'],
- [['mall_id', 'created_at', 'updated_at', 'is_delete', 'deleted_at'], 'integer'],
- [['setting'], 'string'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'setting' => 'Setting',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'is_delete' => 'Is Delete',
- 'deleted_at' => 'Deleted At',
- 'token' => 'token',
- 'expire_time' => '过期时间',
- ];
- }
- public function getConfig($key){
- $setting = Json::decode($this->setting, true);
- return $setting[$key] ?? '';
- }
- }
|