123456789101112131415161718192021222324252627282930313233 |
- <?php
-
- namespace App\Models;
-
- use Illuminate\Database\Eloquent\Model;
-
- class Classify extends Model
- {
- protected $fillable = [
- 'pid', // 父id
- 'name', // 名称
- 'info', // 描述信息
- 'summary', // 富文本简介
- 'server', // 服务标题
- 'content', // 服务详情
- 'photo', // 首页显示的
- 'location', // 显示位置
- 'fields_json', // 自定义字段
- 'api', // 接口字段
- ];
-
- protected $children = [];
-
- public function setChildren($key, $value) {
- $this->children[$key] = $value;
- return;
- }
-
-
- public function options() {
- return $this->hasMany('App\Models\OptionKey', 'classify_id')->withDefault();
- }
- }
|