| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- /**
- * 用户模型.
- *
- * @author jim <jim458734573@gmail.com>
- * @date 2020-01-10 21:03:42
- */
- declare(strict_types=1);
- namespace App\Model;
- use Hyperf\ModelCache\Cacheable;
- use Hyperf\ModelCache\CacheableInterface;
- class PaymentAttrModel extends BaseModel implements CacheableInterface
- {
- // 使用自动缓存.
- use Cacheable;
- /**
- * UUID 键名
- * @var string
- */
- protected $uuidKeyName = 'uid';
- /**
- * 表名.
- *
- * @var string
- */
- protected $table = 'payment_attr';
- /**
- * 钩子函数 数据创建后
- */
- public function created()
- {
- $this->{$this->uuidKeyName} = hashEncodeId($this->id);
- $this->save();
- }
- }
|