* @date 2020-01-29 10:09:06 */ declare(strict_types=1); namespace App\Model; use Hyperf\ModelCache\Cacheable; use Hyperf\ModelCache\CacheableInterface; class TopicCategoryModel extends BaseModel implements CacheableInterface { use Cacheable; /** * 表名. * * @var string */ protected $table = 'topic_category'; public function topics() { return $this->hasMany(TopicModel::class, 'category_id', 'id'); } }