|
@@ -193,6 +193,7 @@ class ProductController extends Controller
|
|
public function productList(Request $request){
|
|
public function productList(Request $request){
|
|
$limit = $request->get('limit',10);
|
|
$limit = $request->get('limit',10);
|
|
$type = $request->get('type');
|
|
$type = $request->get('type');
|
|
|
|
+ $keyword = $request->get('keyword');
|
|
$go = $request->get('go',6);
|
|
$go = $request->get('go',6);
|
|
$query = Product::query()
|
|
$query = Product::query()
|
|
->with('user:id,name,nickname,avatar,company_name,company_card_color,production_project');
|
|
->with('user:id,name,nickname,avatar,company_name,company_card_color,production_project');
|
|
@@ -200,6 +201,10 @@ class ProductController extends Controller
|
|
$type = array_map('intval', explode(',',$type));
|
|
$type = array_map('intval', explode(',',$type));
|
|
$query->whereJsonContains('type',$type);
|
|
$query->whereJsonContains('type',$type);
|
|
}
|
|
}
|
|
|
|
+ if(!empty($keyword)){
|
|
|
|
+// dd($keyword);
|
|
|
|
+ $query->where('name','like','%'.$keyword.'%');
|
|
|
|
+ }
|
|
$list = $query->where('status',1)
|
|
$list = $query->where('status',1)
|
|
->paginate(intval($limit));
|
|
->paginate(intval($limit));
|
|
foreach ($list as $v){
|
|
foreach ($list as $v){
|