Tel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "{{%tel}}".
  6. *
  7. * @property string $id
  8. * @property integer $uid
  9. * @property string $tel
  10. * @property integer $status
  11. * @property integer $type
  12. * @property integer $created_at
  13. */
  14. class Tel extends \yii\db\ActiveRecord
  15. {
  16. const STATUS_DELETED = 0;
  17. const STATUS_ACTIVE = 10;
  18. const TYPE_COMPANY = 10; //公司
  19. const TYPE_CLIENT = 20; //客户
  20. /**
  21. * @inheritdoc
  22. */
  23. public static function tableName()
  24. {
  25. return '{{%tel}}';
  26. }
  27. /**
  28. * @inheritdoc
  29. */
  30. public function rules()
  31. {
  32. return [
  33. [['uid', 'tel', 'status', 'type', 'created_at'], 'required'],
  34. [['uid', 'status', 'type', 'created_at'], 'integer'],
  35. [['tel'], 'string', 'max' => 32],
  36. ];
  37. }
  38. /**
  39. * @inheritdoc
  40. */
  41. public function attributeLabels()
  42. {
  43. return [
  44. 'id' => 'ID',
  45. 'uid' => '用户id',
  46. 'tel' => 'Tel',
  47. 'status' => 'Status',
  48. 'type' => 'Type',
  49. 'created_at' => 'Created At',
  50. ];
  51. }
  52. }