利用模型实现

class Cate extends Model
{
    protected $append = ['children'];

    public function getChildrenAttr($value,$data)
    {
        return Cate::where('fid',$data['id'])->select();
    }
}
 
$data  = (new CateModel())->where(['status'=>1,'recomm'=>1])->select();
 
 

相关文章:

  • 2021-09-21
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-10-01
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2021-08-14
  • 2021-07-27
  • 2022-12-23
  • 2021-04-29
相关资源
相似解决方案