家政小程序
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.

Classify.php 667B

12345678910111213141516171819202122232425262728293031
  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. ];
  16. protected $children = [];
  17. public function setChildren($key, $value) {
  18. $this->children[$key] = $value;
  19. return;
  20. }
  21. public function options() {
  22. return $this->hasMany('App\Models\OptionKey', 'classify_id')->withDefault();
  23. }
  24. }