MchCommonCat.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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;
  10. /**
  11. * This is the model class for table "{{%mch_common_cat}}".
  12. *
  13. * @property integer $id
  14. * @property integer $store_id
  15. * @property string $name
  16. * @property integer $sort
  17. * @property integer $is_delete
  18. */
  19. class MchCommonCat extends \yii\db\ActiveRecord
  20. {
  21. /**
  22. * @inheritdoc
  23. */
  24. public static function tableName()
  25. {
  26. return '{{%mch_common_cat}}';
  27. }
  28. public function behaviors()
  29. {
  30. return [
  31. [
  32. // 自动更新创建和更新时间
  33. 'class' => TimestampBehavior::class,
  34. 'value' => time()
  35. ]
  36. ];
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. public function rules()
  42. {
  43. return [
  44. [['store_id', 'name'], 'required'],
  45. [['store_id', 'sort', 'is_delete', 'is_show'], 'integer'],
  46. [['name'], 'string', 'max' => 255],
  47. ];
  48. }
  49. /**
  50. * @inheritdoc
  51. */
  52. public function attributeLabels()
  53. {
  54. return [
  55. 'id' => 'ID',
  56. 'store_id' => 'Store ID',
  57. 'name' => 'Name',
  58. 'sort' => '排序,升序',
  59. 'is_delete' => 'Is Delete',
  60. ];
  61. }
  62. }