检查所有返回的记录在Laravel中是否具有相同的列值

时间:2019-11-11 22:17:33

标签: php laravel laravel-5

我有以下查询:

ManifestImage::whereBetween('created_at', [$img->created_at, $fewseconds])->whereNull('original_pdf')->get();

这很好地获得了我需要的正确记录,但是我想更进一步。现在,这是一个示例返回:

[{"id":404,"manifest_id":3601,"name":"3601_1559451552023428000.jpeg","mime":"image\/jpeg","type":"jpeg","created_at":"2019-06-01 22:59:12","updated_at":"2019-11-11 14:47:08","original_pdf":null,"image_type":2,"temp_group":null}, {"id":405,"manifest_id":3601,"name":"3601_1559451552068266200.jpeg","mime":"image\/jpeg","type":"jpeg","created_at":"2019-06-01 22:59:12","updated_at":"2019-11-11 14:47:08","original_pdf":null,"image_type":2,"temp_group":null},{"id":406,"manifest_id":3601,"name":"3601_1559451553041321000.jpeg","mime":"image\/jpeg","type":"jpeg","created_at":"2019-06-01 22:59:13","updated_at":"2019-11-11 14:47:08","original_pdf":null,"image_type":2,"temp_group":null}]

我想检查的是,以上返回的所有记录是否只有manifest_id的一个值。所有这些都具有3601的值,所以我想做的是通过一个条件语句,如果该条件集中只有一个唯一的数字,则继续下一步,否则将其完全跳过。

0 个答案:

没有答案