Advert.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%advert}}".
  6. *
  7. * @property integer $id
  8. * @property string $name
  9. * @property string $link
  10. * @property string $imgurl
  11. * @property integer $orderby
  12. * @property integer $created_at
  13. * @property integer $updated_at
  14. * @property integer $admin_id
  15. * @property integer $click_count
  16. * @property integer $status
  17. */
  18. class Advert extends \yii\db\ActiveRecord
  19. {
  20. /**
  21. * @inheritdoc
  22. */
  23. const ADVERT_STATE_SHOW = 1;//显示
  24. const ADVERT_STATE_NOT= 0;//不显示
  25. const ADVERT_STATE_DEL = 2;//删除状态
  26. public static function tableName()
  27. {
  28. return '{{%advert}}';
  29. }
  30. /**
  31. * @inheritdoc
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['imgurl'], 'required'],
  37. [['imgurl'], 'string'],
  38. [['orderby', 'created_at', 'updated_at','hid', 'created_author','updated_author', 'click_count', 'status'], 'integer'],
  39. [['name'], 'string', 'max' => 64],
  40. [['link'], 'string', 'max' => 255],
  41. ];
  42. }
  43. /**
  44. * @inheritdoc
  45. */
  46. public function attributeLabels()
  47. {
  48. return [
  49. 'id' => 'ID',
  50. 'name' => 'Name',
  51. 'hid' => '房子id',
  52. 'link' => 'Link',
  53. 'imgurl' => 'Imgurl',
  54. 'orderby' => 'Orderby',
  55. 'created_at' => 'Created At',
  56. 'updated_at' => 'Updated At',
  57. 'created_author' => 'Admin Author',
  58. 'updated_author'=>'Apdated Author',
  59. 'click_count' => 'Click Count',
  60. 'status' => 'Status',
  61. ];
  62. }
  63. }