Migration.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\db\ActiveRecord;
  9. use yii\behaviors\TimestampBehavior;
  10. use Yii;
  11. /**
  12. * This is the model class for table "{{%migration}}".
  13. *
  14. * @property int $id
  15. * @property int|null $store_id
  16. * @property int|null $updated_at
  17. * @property int|null $created_at
  18. * @property string|null $down_url
  19. * @property int|null $status
  20. */
  21. class Migration extends \yii\db\ActiveRecord
  22. {
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public static function tableName()
  27. {
  28. return '{{%migration}}';
  29. }
  30. public function behaviors()
  31. {
  32. return [
  33. [
  34. 'class' => TimestampBehavior::class,
  35. 'attributes' => [
  36. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  37. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  38. ]
  39. ]
  40. ];
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. public function rules()
  46. {
  47. return [
  48. [['store_id', 'updated_at', 'created_at', 'status'], 'integer'],
  49. [['store_id'], 'required'],
  50. [['down_url'], 'string', 'max' => 255],
  51. ];
  52. }
  53. /**
  54. * {@inheritdoc}
  55. */
  56. public function attributeLabels()
  57. {
  58. return [
  59. 'id' => 'ID',
  60. 'store_id' => 'Store ID',
  61. 'updated_at' => 'Updated At',
  62. 'created_at' => 'Created At',
  63. 'down_url' => 'Down Url',
  64. 'status' => 'Status',
  65. ];
  66. }
  67. }