UserMoneyLog.php 765 B

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