Share.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%building}}".
  6. *
  7. * @property string $id
  8. * @property integer $uid
  9. * @property integer $type
  10. * @property string $latitude
  11. * @property string $longitude
  12. * @property string $city
  13. * @property string $district
  14. * @property string $address
  15. */
  16. class Share extends \yii\db\ActiveRecord
  17. {
  18. const STATUS_YES = 10;//工地类型
  19. const STATUS_NO = 0;//样板房类型
  20. /**
  21. * @inheritdoc
  22. */
  23. public static function tableName()
  24. {
  25. return '{{%share}}';
  26. }
  27. /**
  28. * @inheritdoc
  29. */
  30. public function rules()
  31. {
  32. return [
  33. [['role', 'name', 'tel'], 'required'],
  34. [['c_time'], 'integer'],
  35. [['c_time'], 'default','value'=>time()],
  36. [['name','tel'], 'string', 'max' => 32],
  37. ];
  38. }
  39. /**
  40. * @inheritdoc
  41. */
  42. public function attributeLabels()
  43. {
  44. return [
  45. 'id' => 'ID',
  46. 'role' => 'role',
  47. 'name' => 'name',
  48. 'tel' => 'tel',
  49. 'c_time' => 'c_time',
  50. 'status' => 'Status',
  51. ];
  52. }
  53. }