| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%warehouse}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property string $name
- * @property integer $sort
- * @property integer $is_delete
- */
- class Warehouse extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%warehouse}}';
- }
- public function rules()
- {
- return [
- [['id', 'sort', 'is_delete', 'store_id'], 'integer'],
- [['name'], 'string'],
- [['created_at', 'updated_at'], 'safe']
- ];
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
- ]
- ]
- ];
- }
- }
|