MailRecord.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace backend\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "crm_mail_record".
  6. *
  7. * @property integer $id
  8. * @property string $subject
  9. * @property string $content
  10. * @property string $receiver
  11. * @property integer $status
  12. * @property integer $in_time
  13. */
  14. class MailRecord extends \yii\db\ActiveRecord
  15. {
  16. /**
  17. * @inheritdoc
  18. */
  19. public static function tableName()
  20. {
  21. return 'crm_mail_record';
  22. }
  23. /**
  24. * @return \yii\db\Connection the database connection used by this AR class.
  25. */
  26. public static function getDb()
  27. {
  28. return Yii::$app->get('dbXcrm');
  29. }
  30. /**
  31. * @inheritdoc
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['subject', 'content', 'receiver', 'in_time'], 'required'],
  37. [['content'], 'string'],
  38. [['status', 'in_time'], 'integer'],
  39. [['subject', 'receiver'], 'string', 'max' => 255],
  40. ];
  41. }
  42. /**
  43. * @inheritdoc
  44. */
  45. public function attributeLabels()
  46. {
  47. return [
  48. 'id' => 'ID',
  49. 'subject' => 'Subject',
  50. 'content' => 'Content',
  51. 'receiver' => 'Receiver',
  52. 'status' => 'Status',
  53. 'in_time' => 'In Time',
  54. ];
  55. }
  56. }