腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
Laravel
集合
-
多个
where
条件
php
、
laravel
、
collections
有没有办法将
多个
where
条件
传递到
Laravel
的
集合
中?我的意思是这样的:$found = $collection->
where
($filters)->first(); 我知道它可以与雄辩的查询构建器一起工作,但不能完全与
集合<
浏览 13
提问于2018-09-04
得票数 1
2
回答
如何在
Laravel
中sortBy()
多个
值?
php
、
laravel
、
laravel-collection
看起来
Laravel
没有提供按
多个
条件
排序的方法。在我的实例中,我希望按照我调用的sort_order的值按升序排列
集合
,然后按降序排列日期。$item->sortBy('sort_order')->sortByDesc('date'); 这将按第一个
条件
排序,然后用第二个
条件
覆盖先前的sortBy。根据我在
laravel
中读到的内容,它不支持这一点。其他人有没有遇到过这个问题?如果有,你是如何解决的? 我正在使用<e
浏览 49
提问于2019-02-04
得票数 0
1
回答
Laravel
集合
where
子句
php
、
laravel
、
collections
在
Laravel
中,是否可以将
where
条件
应用于一个
集合
,并将结果放入另一个
集合
中,而不更改第一个
集合
?例如: ->select("*") if ($voce_spesa["Ma
浏览 2
提问于2017-06-10
得票数 2
回答已采纳
1
回答
Laravel
Sql
多个
Where
条件
mysql
、
laravel
$items = property::orderBy('id', 'desc') ->whereProperty_categoryAndProperty_for_sale_or_rent('apartment', 'rent') ->paginate('9'); 您好,请告诉我关于这个多选类
浏览 12
提问于2019-12-26
得票数 0
回答已采纳
5
回答
动态LINQ或
条件
linq
我希望使用LINQ对
集合
执行
多个
where
条件
,类似于items.
Where
(p => p.FirstName = "John");除了具有
多个
条件
和
条件
(如本例)外,我希望有
多个
OR
条件
。编辑对不起
浏览 2
提问于2010-12-08
得票数 19
回答已采纳
2
回答
如何根据
条件
从拉拉雄辩的收藏品中获得物品?
laravel
、
collections
、
eloquent
我使用
laravel
雄辩的来获取给我提供一个
集合
的post文件,但我希望通过
条件
从该
集合
中获得一个项目。例如,从该
集合
中,我想要一个type = 'product'项。我正在使用foreach和检查每一个有我的
条件
的项目,并返回它,但不是更好的方式吗?文件项有类型,该值为“产品”或“博客”。我的代码: $post= Post::
where
('slug' , $s
浏览 3
提问于2019-10-11
得票数 0
回答已采纳
2
回答
Laravel
Where
和OrWhere
多个
条件
laravel
我有以下疑问: ->
where
('user_id','=',$this->id) ->
where</e
浏览 6
提问于2016-09-01
得票数 1
1
回答
有没有办法在eloquent中传递这样的
条件
:如果key存在,那么不要从
集合
中发送对象(在mongodb中)?
laravel
、
mongodb
、
eloquent
我正在使用jenssegers/
laravel
-mongodb,我有一个
集合
片段,我不想让那些对象通过eloquent发送,它具有名为'unrooted‘的键,也就是传递一个
条件
来检查
集合
中是否设置了$segments = Segment::
where
($condition)->get(); 我知道它可以像让所有对象都通过
条件
一样完成,然后 foreach($segments as $key =>unrooted')){ unse
浏览 12
提问于2020-07-14
得票数 2
回答已采纳
2
回答
laravel
DB:用于
多个
选定字段的
多个
where
和Or
条件
的表
php
、
laravel-5
、
laravel-5.2
、
laravel-5.3
My query like :
where
('this', '=', 1)->
where
('this_too', '=', 1)->
where
('this_as_w
浏览 5
提问于2018-02-02
得票数 2
回答已采纳
2
回答
如何仅以字符串而不是
集合
的形式返回值?
laravel
这个雄辩的
集合
提供了这一结果:print_r($id) ( ) 如何只返回"31242682774“值作为字符串而不是
集合
编辑答案:$id = Model::<
浏览 3
提问于2019-11-27
得票数 0
回答已采纳
5
回答
Eloquent仅将一列作为数组获取
php
、
laravel
、
eloquent
如何使用eloquent在
laravel
5.2中只获取一列作为一维数组?我试过了:但这里给出的是二维数组
浏览 17
提问于2016-01-21
得票数 115
回答已采纳
1
回答
如何基于
Laravel
项目中的多列来堆叠相同的数据库结果?
laravel
、
laravel-9
在
Laravel
项目中,我有一个包含以下列的shapes表:我如何‘叠加’所有的形状,是相同的宽度,高度,重量和颜色匹配?到目前为止,我尝试使用groupBy方法,但是当我使用
多个
条件
时,它会将结果放在
集合
内部的
集合
中,等等。Shape::latest()->get()->groupBy(['width', 'height', 'weight', 'color
浏览 2
提问于2022-09-21
得票数 0
回答已采纳
1
回答
Laravel
查询:
where
子句中有
多个
条件
,但1个
条件
需要比较运算符
php
、
laravel
、
where-clause
我一直在尝试使用
Laravel
select查询,它需要
多个
AND
条件
。($myArray)->get();DB::('mytable')->select('mycolumn')->
where
('column_one', 1)->
where
('column_two' '<', 10000)-&g
浏览 1
提问于2016-02-21
得票数 1
1
回答
在countBy之后如何使用orderBy?
mysql
、
laravel
、
laravel-livewire
我有两个表products和votes,每个product可以有
多个
投票。 我需要的是每个产品的总投票,这是orderBy DESC。
浏览 17
提问于2021-05-10
得票数 0
3
回答
拉勒维尔是如何处理关系的?
laravel
假设我们执行这个$users = User::with('comments')->get();,它将执行select * from `comments`
where
`user_id` in (1, 2, 3, 4, 5)foreach ($users as $user) { $user->commen
浏览 10
提问于2022-02-14
得票数 2
回答已采纳
2
回答
为什么
Laravel
以字符串(5) "Sally“的形式返回Db::table查询
php
、
database
、
laravel
为什么
laravel
会返回一个包含过多信息的查询。为什么这个查询:生成此stdClass条目: ["email"]=> string(21) "webmaster
浏览 8
提问于2016-04-07
得票数 2
回答已采纳
4
回答
使用多列、多
条件
的
Laravel
更新查询
laravel
、
eloquent
我们能否根据
Laravel
中的
多个
不同
条件
更新
多个
列,让我们用雄辩的话说,我想 Design::
where
('name','B')->update(['override_value'=>
浏览 11
提问于2022-09-23
得票数 0
1
回答
Laravel
中的
多个
where
和or
条件
laravel
如何准备
多个
where
条件
的查询
条件
。2021-05-01或dataIT = 2021-05-10和dataFT = 2021-06-10 $result=DB::table('timbraturas') ->
where
('nome',$nome) ->whereMonth(&
浏览 82
提问于2021-05-04
得票数 0
2
回答
Angular 6- AnguarFire -使用
多个
文档字段查询
集合
angular
、
firebase
、
google-cloud-firestore
、
angularfire2
我在我的项目中使用了AngularFire & Cloud Firestore,我需要对一个
集合
进行多
条件
(
Where
)查询。 .
where
('size', '==', 'large')
浏览 0
提问于2018-11-27
得票数 1
1
回答
基于
条件
的
Laravel
集合
排序Desc/Asc
laravel-8
我有
laravel
集合
,我想根据状态值的
条件
对其进行排序,如果状态== 3的订购将是id desc,否则订购将是id asc,请帮助。 基于炭疽柱值
条件
的
laravel
采集分类尝试
浏览 6
提问于2022-11-23
得票数 0
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
即时通信 IM
云直播
活动推荐
运营活动
广告
关闭
领券