Aboutwe.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%aboutwe}}".
  6. *
  7. * @property string $id
  8. * @property string $address
  9. * @property string $tell
  10. * @property string $content
  11. * @property string $time
  12. * @property integer $email
  13. * @property integer $updated_at
  14. * @property integer $created_at
  15. */
  16. class Aboutwe extends \yii\db\ActiveRecord
  17. {
  18. /**
  19. * @inheritdoc
  20. */
  21. public static function tableName()
  22. {
  23. return '{{%aboutwe}}';
  24. }
  25. /**
  26. * @inheritdoc
  27. */
  28. public function rules()
  29. {
  30. return [
  31. [['content'], 'string'],
  32. [[ 'updated_at'], 'integer'],
  33. [['address', 'tell', 'wechat','email','coordinate','company'], 'string', 'max' => 255],
  34. ];
  35. }
  36. /**
  37. * @inheritdoc
  38. */
  39. public function attributeLabels()
  40. {
  41. return [
  42. 'id' => 'ID',
  43. 'address' => 'Address',
  44. 'tell' => 'Tell',
  45. 'content' => 'Content',
  46. 'wechat' => 'Wechat',
  47. 'company' => 'Company',
  48. 'email' => 'Email',
  49. 'updated_at' => 'Updated At',
  50. 'coordinate' => 'Coordinate'
  51. ];
  52. }
  53. public static function getAboutwe(){
  54. $model = Aboutwe::find()->one();
  55. return $model;
  56. }
  57. }