【发布时间】:2021-01-19 15:46:13
【问题描述】:
我无法理解<> 在->where('id', '<>', $id) 中的用途
protected function getRelatedSlugs($slug, $id = 0){
return Product::select('slug')
->where('slug', 'like', $slug.'%')
->where('id', '<>', $id)->get();
}
【问题讨论】:
-
@sta — 因为在 PHP 中它只是一个字符串,不是真的。