| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use yii\helpers\Json;
- /**
- * This is the model class for table "{{%cloud}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property integer $mch_id
- * @property string $name
- * @property string $cloud_type
- * @property string $cloud_setting
- * @property integer $is_delete
- * @property integer $created_at
- * @property integer $updated_at
- */
- class Cloud extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%cloud}}';
- }
- public function behaviors()
- {
- return [
- [
- // 自动更新创建和更新时间
- 'class' => TimestampBehavior::class,
- 'value' => time()
- ]
- ];
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['store_id', 'mch_id', 'is_delete', 'created_at', 'updated_at'], 'integer'],
- [['cloud_setting'], 'string'],
- [['name', 'cloud_type'], 'string', 'max' => 255],
- ['mch_id', 'default', 'value' => 0]
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'mch_id' => '商户主键',
- 'name' => '打印机名称',
- 'cloud_type' => '打印机类型',
- 'cloud_setting' => '打印机设置',
- 'is_delete' => 'Is Delete',
- 'updated_at' => '更新时间',
- 'created_at' => '创建时间'
- ];
- }
- public function beforeSave($insert)
- {
- return true;
- // $this->name = Json::encode($this->name);
- // return parent::beforeSave($insert);
- }
- }
|