| 12345678910111213141516171819202122232425262728293031 |
- <?php
- /**
- * 话题分类模型.
- *
- * @author jim <jim458734573@gmail.com>
- * @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');
- }
- }
|