| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- /**
- * This is the model class for table "{{%goods_book}}".
- *
- * @property integer $id
- * @property integer $goods_id
- * @property string $date_book
- * @property string $service_book
- * @property integer $created_at
- */
- class GoodsBook extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%goods_book}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['goods_id'], 'required'],
- [['created_at', 'goods_id'], 'integer'],
- [['date_book', 'service_book'], 'string'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'goods_id' => '商品id',
- 'date_book' => '酒店预约商品',
- 'service_book' => '服务预约商品',
- 'created_at' => 'Addtime',
- ];
- }
- public function beforeSave($insert)
- {
- if (parent::beforeSave($insert)) {
- if ($this->isNewRecord) {
- $this->created_at = time();
- }
- return true;
- }
- return false;
- }
- }
|