Single.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace addons\TinyBlog\common\models;
  3. use common\behaviors\MerchantStoreBehavior;
  4. /**
  5. * This is the model class for table "{{%addon_tiny_blog_single}}".
  6. *
  7. * @property int $id 主键
  8. * @property int|null $merchant_id 商户id
  9. * @property int|null $store_id 店铺id
  10. * @property string $title 标题
  11. * @property string|null $name 标识
  12. * @property string|null $seo_key seo关键字
  13. * @property string|null $seo_content seo内容
  14. * @property string|null $cover 封面
  15. * @property string|null $description 描述
  16. * @property string|null $content 文章内容
  17. * @property string|null $link 外链
  18. * @property string|null $author 作者
  19. * @property int $view 浏览量
  20. * @property int $sort 优先级
  21. * @property int|null $status 状态
  22. * @property int $created_at 创建时间
  23. * @property int $updated_at 更新时间
  24. */
  25. class Single extends \common\models\base\BaseModel
  26. {
  27. use MerchantStoreBehavior;
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public static function tableName()
  32. {
  33. return '{{%addon_tiny_blog_single}}';
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function rules()
  39. {
  40. return [
  41. [['merchant_id', 'store_id', 'view', 'sort', 'status', 'created_at', 'updated_at'], 'integer'],
  42. [['title'], 'required'],
  43. [['content'], 'string'],
  44. [['title', 'seo_key'], 'string', 'max' => 50],
  45. [['name', 'author'], 'string', 'max' => 40],
  46. [['seo_content'], 'string', 'max' => 1000],
  47. [['cover'], 'string', 'max' => 100],
  48. [['description'], 'string', 'max' => 140],
  49. [['link'], 'string', 'max' => 255],
  50. ];
  51. }
  52. /**
  53. * {@inheritdoc}
  54. */
  55. public function attributeLabels()
  56. {
  57. return [
  58. 'id' => '主键',
  59. 'merchant_id' => '商户id',
  60. 'store_id' => '店铺id',
  61. 'title' => '标题',
  62. 'name' => '标识',
  63. 'seo_key' => 'seo关键字',
  64. 'seo_content' => 'seo内容',
  65. 'cover' => '封面',
  66. 'description' => '描述',
  67. 'content' => '文章内容',
  68. 'link' => '外链',
  69. 'author' => '作者',
  70. 'view' => '浏览量',
  71. 'sort' => '优先级',
  72. 'status' => '状态',
  73. 'created_at' => '创建时间',
  74. 'updated_at' => '更新时间',
  75. ];
  76. }
  77. }
粤ICP备19079148号