IntelligentScene.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. * Class Cat
  12. * @package app\modules\models
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property integer $cat_id
  16. * @property string $name
  17. * @property string $pic_url
  18. * @property integer $is_delete
  19. * @property integer $status
  20. * @property integer $created_at
  21. * @property integer $updated_at
  22. * @property integer $is_default
  23. */
  24. class IntelligentScene extends ActiveRecord
  25. {
  26. /**
  27. * 分类是否显示:显示
  28. */
  29. const IS_SHOW_TRUE = 1;
  30. /**
  31. * 分类是否显示:不显示
  32. */
  33. const IS_SHOW_FALSE = 0;
  34. public function behaviors()
  35. {
  36. return [
  37. [
  38. // 自动更新创建和更新时间
  39. 'class' => TimestampBehavior::class,
  40. 'value' => time()
  41. ]
  42. ];
  43. }
  44. public static function tableName()
  45. {
  46. return '{{%intelligent_scene}}';
  47. }
  48. public function rules()
  49. {
  50. return [
  51. [['store_id', 'name', 'pic_url'], 'required'],
  52. [['store_id', 'created_at', 'updated_at', 'is_delete', 'status','cat_id','is_default'], 'integer'],
  53. [['name','pic_url'], 'string', 'max' => 255],
  54. [['is_default'], 'default', 'value' => 0],
  55. ];
  56. }
  57. public function attributeLabels()
  58. {
  59. return [
  60. 'id' => 'ID',
  61. 'store_id' => '商城id',
  62. 'name' => '场景名称',
  63. 'pic_url' => '场景图片',
  64. 'created_at' => '创建时间',
  65. 'updated_at' => '更新时间',
  66. 'is_delete' => 'Is Delete',
  67. 'status' => '是否显示',
  68. 'cat_id' => '分类ID',
  69. 'is_default' => '是否是默认'
  70. ];
  71. }
  72. }