HotSearch.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%hot_search}}".
  6. *
  7. * @property integer $id
  8. * @property string $keyword
  9. * @property integer $create_at
  10. */
  11. class HotSearch extends \yii\db\ActiveRecord
  12. {
  13. /**
  14. * @inheritdoc
  15. */
  16. const HOT_SEARCH_COMMON = 1;//热门搜索存在
  17. const HOT_SEARCH_DEL = 0;//热门搜索删除
  18. public static function tableName()
  19. {
  20. return '{{%hot_search}}';
  21. }
  22. /**
  23. * @inheritdoc
  24. */
  25. public function rules()
  26. {
  27. return [
  28. [['keyword', 'create_at','status'], 'required'],
  29. [['create_at','updated_at','status'], 'integer'],
  30. [['keyword'], 'string', 'max' => 64],
  31. ];
  32. }
  33. /**
  34. * @inheritdoc
  35. */
  36. public function attributeLabels()
  37. {
  38. return [
  39. 'id' => 'ID',
  40. 'keyword' => 'Keyword',
  41. 'create_at' => 'Create At',
  42. 'updated_at' => 'Updated At',
  43. 'status' => 'status',
  44. ];
  45. }
  46. }