CompanyApply.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. class CompanyApply extends \yii\db\ActiveRecord
  5. {
  6. const STATUS_REVIEW = 0;//等待审核中
  7. const STATUS_FAIL = -1;//审核失败
  8. const STATUS_SUCCESS = 10;//审核成功
  9. /**
  10. * @inheritdoc
  11. */
  12. public static function tableName()
  13. {
  14. return '{{%company_apply}}';
  15. }
  16. /**
  17. * @inheritdoc
  18. */
  19. public function rules()
  20. {
  21. return [
  22. ['status', 'default', 'value' => self::STATUS_REVIEW],
  23. [['created_at','updated_at'],'default','value'=>time()],
  24. [['name', 'tel','created_at', 'status', 'updated_at'], 'required'],
  25. [['created_at', 'status', 'updated_at'], 'integer'],
  26. [['name','tel','username'], 'string', 'max' => 32],
  27. ];
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function attributeLabels()
  33. {
  34. return [
  35. 'id' => 'ID',
  36. 'name'=>'公司名称',
  37. 'tel'=>'手机号',
  38. 'status' => 'Status',
  39. 'created_at' => '创建时间',
  40. 'updated_at' => 'Updated At',
  41. ];
  42. }
  43. }