家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Classify extends Model
  5. {
  6. protected $fillable = [
  7. 'pid', // 父id
  8. 'name', // 名称
  9. 'info', // 描述信息
  10. 'summary', // 富文本简介
  11. 'server', // 服务标题
  12. 'content', // 服务详情
  13. 'photo', // 首页显示的
  14. 'location', // 显示位置
  15. 'fields_json', // 自定义字段
  16. 'api', // 接口字段
  17. ];
  18. protected $children = [];
  19. public function setChildren($key, $value) {
  20. $this->children[$key] = $value;
  21. return;
  22. }
  23. public function options() {
  24. return $this->hasMany('App\Models\OptionKey', 'classify_id')->withDefault();
  25. }
  26. }