em.....有点意思的
理论上文件的配置文件是一次性修改, 如果你需要频繁修改最好是设计成后台可配存数据库, 而不是去更改文件. 当然简单的方法就是使用config() 方法获取config文件内数组数据, 你再修改数据, 再保存覆盖文件就可以了
我试试...好像有点意思的
我有Model
Position , Block , Nodes
Position --> hasMany --> Block
Block --> hasMany --> Nodes
我想要查找Nodes, 按 ID desc排序, Limit 6条
Position::with(['block.nodes']);
我想要查找 position 里面的 block, 对应的 node , 但是 node 要按 id 排序,limit 6 条
==================UPdate===============
好像不合理....
看来只能预加载一个block, 在查询nodes
就是type_id 作为value, 这样也是可以的 ...
我现有表
videos:
id , title
posts:
id , title, category_id
comments:
id, title, commentable_id, commentable_type
表category , post 与 block 之间是多态关联.
如现在有数据:
video1 , video2 , video3,
post1, post2, post3
comment1 -- video1
comment2 -- video1
comment3 -- video1
comment4 -- video2
comment5 -- video2
comment6 -- post1
comment7 -- post2
comment8 -- post2
comment9 -- post2
comment10 -- video2
我现在想要在 Comment 做一个筛选功能
我想要实现一个 select , select中的options value是 video / post 的id, label是 video / post 的title.
然后选中一个select, 就筛选出对应的comments
可以实现这样的一个select吗? 还是需要分别实现两个 select
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property 'get' of undefined"