SearchRecord.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%search_record}}".
  6. *
  7. * @property int $id ID
  8. * @property int $content_model_id 关联模型
  9. * @property string $keyword 搜索词
  10. * @property int $result_num 返回结果数
  11. * @property int $times 搜索次数
  12. * @property int $recommend 推荐
  13. * @property int $create_time 搜索时间
  14. */
  15. class SearchRecord extends \app\common\models\EActiveRecord
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function tableName()
  21. {
  22. return '{{%search_record}}';
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['content_model_id', 'result_num', 'times', 'recommend', 'create_time'], 'integer'],
  31. [['keyword'], 'string', 'max' => 100],
  32. [['keyword'], 'required'],
  33. ];
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function attributeLabels()
  39. {
  40. return [
  41. 'id' => Yii::t('attr','search_record.id'),
  42. 'content_model_id' => Yii::t('attr','search_record.content_model_id'),
  43. 'keyword' => Yii::t('attr','search_record.keyword'),
  44. 'result_num' => Yii::t('attr','search_record.result_num'),
  45. 'times' => Yii::t('attr','search_record.times'),
  46. 'recommend' => Yii::t('attr','search_record.recommend'),
  47. 'create_time' => Yii::t('attr','search_record.create_time'),
  48. ];
  49. }
  50. }