PaymentAttrModel.php 719 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * 用户模型.
  4. *
  5. * @author jim <jim458734573@gmail.com>
  6. * @date 2020-01-10 21:03:42
  7. */
  8. declare(strict_types=1);
  9. namespace App\Model;
  10. use Hyperf\ModelCache\Cacheable;
  11. use Hyperf\ModelCache\CacheableInterface;
  12. class PaymentAttrModel extends BaseModel implements CacheableInterface
  13. {
  14. // 使用自动缓存.
  15. use Cacheable;
  16. /**
  17. * UUID 键名
  18. * @var string
  19. */
  20. protected $uuidKeyName = 'uid';
  21. /**
  22. * 表名.
  23. *
  24. * @var string
  25. */
  26. protected $table = 'payment_attr';
  27. /**
  28. * 钩子函数 数据创建后
  29. */
  30. public function created()
  31. {
  32. $this->{$this->uuidKeyName} = hashEncodeId($this->id);
  33. $this->save();
  34. }
  35. }