MemberUpgradeRecord.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. * @Author: chaimeihan 1852293413@qq.com
  4. * @Date: 2024-04-23 14:24:47
  5. * @LastEditors: chaimeihan 1852293413@qq.com
  6. * @LastEditTime: 2024-04-26 10:09:04
  7. * @FilePath: \PHP\models\MemberUpgradeRecord.php
  8. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  9. */
  10. namespace app\models;
  11. use Yii;
  12. use yii\behaviors\TimestampBehavior;
  13. use yii\db\ActiveRecord;
  14. class MemberUpgradeRecord extends \yii\db\ActiveRecord
  15. {
  16. /**
  17. * @inheritdoc
  18. */
  19. public static function tableName()
  20. {
  21. return '{{%member_upgrade_record}}';
  22. }
  23. public function behaviors()
  24. {
  25. return [
  26. [
  27. 'class' => TimestampBehavior::class,
  28. 'attributes' => [
  29. ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
  30. ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
  31. ]
  32. ]
  33. ];
  34. }
  35. /**
  36. * @inheritdoc
  37. */
  38. public function rules()
  39. {
  40. return [
  41. [['old_level_id', 'new_level_id', 'recharge_id', 'user_id', 'created_at'], 'number'],
  42. ];
  43. }
  44. /**
  45. * @inheritdoc
  46. */
  47. public function attributeLabels()
  48. {
  49. return [];
  50. }
  51. }