【发布时间】:2020-03-07 07:11:49
【问题描述】:
我想获取价格大于或等于指定值的数据(取自输入)。
$minPrice = $request->min_price;
$maxPrice = $request->max_price;
$value = Dproduct::where(['status' => 1])->where('price', '>', $minPrice)->get();
但价格是数据库中的 JSON,我无法得到它。货币如:VND、USD、TWD、...
尊重所有答案! 非常感谢!
【问题讨论】:
-
数据库列是json类型的吗?你使用的是哪个 laravel 版本?你可以使用json where clauses
-
@Remul 我保存的价格是json,我的版本是5.7
标签: php laravel eloquent mysql-json