Donation.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace plugins\donation\models;
  3. use Yii;
  4. use yii\behaviors\TimestampBehavior;
  5. /**
  6. * This is the model class for table "{{%donation}}".
  7. *
  8. * @property integer $id
  9. * @property string $name
  10. * @property string $money
  11. * @property string $remark
  12. * @property integer $created_at
  13. * @property integer $updated_at
  14. */
  15. class Donation extends \yii\db\ActiveRecord
  16. {
  17. /**
  18. * @inheritdoc
  19. */
  20. public static function tableName()
  21. {
  22. return '{{%donation}}';
  23. }
  24. public function behaviors()
  25. {
  26. return [
  27. TimestampBehavior::className()
  28. ];
  29. }
  30. /**
  31. * @inheritdoc
  32. */
  33. public function rules()
  34. {
  35. return [
  36. [['name', 'money'], 'required'],
  37. [['money'], 'number'],
  38. [['name'], 'string', 'max' => 50],
  39. [['remark', 'source'], 'string', 'max' => 255],
  40. ];
  41. }
  42. /**
  43. * @inheritdoc
  44. */
  45. public function attributeLabels()
  46. {
  47. return [
  48. 'id' => 'ID',
  49. 'name' => '姓名',
  50. 'money' => '金额(元)',
  51. 'remark' => '留言',
  52. 'source' => '来源',
  53. 'created_at' => '时间',
  54. 'updated_at' => '更新时间',
  55. ];
  56. }
  57. }