| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\model\blue;
- use app\extra\basic\Model;
- use think\model\relation\HasMany;
- /**
- * @property integer $id (主键)
- * @property string $name 名称
- * @property string $icon 普通图标
- * @property string $small_icon 小图标
- * @property integer $sort 排序
- * @property integer $type 1任务2文章
- * @property mixed $create_at 创建时间
- */
- class BlueCategory extends Model
- {
- /**
- * The connection name for the model.
- *
- * @var string|null
- */
- protected $connection = 'mysql';
-
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected string $table = "blue_category";
-
- /**
- * The primary key associated with the table.
- *
- * @var string
- */
- protected string $primaryKey = "id";
-
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public bool $timestamps = false;
- public function article(): HasMany
- {
- return $this->hasMany(BlueArticle::class,"category","id");
- }
- }
|