Fang.php 551 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: qisse
  5. * Date: 2017/6/27
  6. * Time: 20:02
  7. */
  8. namespace app\core\model;
  9. use think\Model;
  10. use tool\Common;
  11. class Fang extends Model
  12. {
  13. protected $pk = 'fangID';
  14. protected $resultSetType = 'collection';
  15. protected $updateTime = 'updateTime';
  16. protected $createTime = 'addTime';
  17. protected $autoWriteTimestamp = true;
  18. public function setMoneyAttr($value) {
  19. return $value * 100;
  20. }
  21. public function getMoneyAttr($value) {
  22. return Common::price2($value / 100);
  23. }
  24. }