UserMoneyLog.php 777 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\common\model;
  3. use think\model;
  4. class UserMoneyLog extends model
  5. {
  6. protected $autoWriteTimestamp = true;
  7. protected $updateTime = false;
  8. public function getMoneyAttr($value): string
  9. {
  10. return bcdiv($value, 100, 2);
  11. }
  12. public function setMoneyAttr($value): string
  13. {
  14. return bcmul($value, 100, 2);
  15. }
  16. public function getBeforeAttr($value): string
  17. {
  18. return bcdiv($value, 100, 2);
  19. }
  20. public function setBeforeAttr($value): string
  21. {
  22. return bcmul($value, 100, 2);
  23. }
  24. public function getAfterAttr($value): string
  25. {
  26. return bcdiv($value, 100, 2);
  27. }
  28. public function setAfterAttr($value): string
  29. {
  30. return bcmul($value, 100, 2);
  31. }
  32. }