AccessoriesWorks.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 $user_id
  16. * @property string $user_name
  17. * @property string $image
  18. * @property string $goods_ids
  19. * @property integer $created_at
  20. * @property integer $updated_at
  21. */
  22. class AccessoriesWorks extends ActiveRecord
  23. {
  24. /**
  25. * 分类是否显示:显示
  26. */
  27. const IS_SHOW_TRUE = 1;
  28. /**
  29. * 分类是否显示:不显示
  30. */
  31. const IS_SHOW_FALSE = 0;
  32. public function behaviors()
  33. {
  34. return [
  35. [
  36. // 自动更新创建和更新时间
  37. 'class' => TimestampBehavior::class,
  38. 'value' => time()
  39. ]
  40. ];
  41. }
  42. public static function tableName()
  43. {
  44. return '{{%accessories_works}}';
  45. }
  46. public function rules()
  47. {
  48. return [
  49. [['store_id', 'image'], 'required'],
  50. [['store_id', 'created_at', 'user_id','updated_at'], 'integer'],
  51. [['user_name','image','goods_ids'], 'string', 'max' => 255],
  52. ];
  53. }
  54. public function attributeLabels()
  55. {
  56. return [
  57. 'id' => 'ID',
  58. 'store_id' => '商城id',
  59. 'user_id' => '用户ID',
  60. 'user_name' => '用户昵称',
  61. 'image' => '场景图片',
  62. 'goods_ids' => '关联商品ID',
  63. 'created_at' => '创建时间',
  64. 'updated_at' => '更新时间'
  65. ];
  66. }
  67. }