WarehouseZone.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * 厦门云联储网络科技有限公司
  4. * https://www.baokuaiyun.com
  5. * Copyright (c) 2023 爆块云 All rights reserved.
  6. */
  7. namespace app\models;
  8. use yii\behaviors\TimestampBehavior;
  9. use yii\db\ActiveRecord;
  10. /**
  11. * This is the model class for table "{{%warehouse_zone}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property string $name
  16. * @property integer $sort
  17. * @property integer $warehouse_id
  18. * @property integer $is_delete
  19. */
  20. class WarehouseZone extends \yii\db\ActiveRecord
  21. {
  22. /**
  23. * @inheritdoc
  24. */
  25. public static function tableName()
  26. {
  27. return '{{%warehouse_zone}}';
  28. }
  29. public function rules()
  30. {
  31. return [
  32. [['id', 'sort', 'is_delete', 'store_id', 'warehouse_id'], 'integer'],
  33. [['name'], 'string'],
  34. [['created_at', 'updated_at'], 'safe']
  35. ];
  36. }
  37. public function behaviors()
  38. {
  39. return [
  40. [
  41. 'class' => TimestampBehavior::class,
  42. 'attributes' => [
  43. ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
  44. ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
  45. ]
  46. ]
  47. ];
  48. }
  49. }