-- 10 select*from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =10 orderby create_at desc limit 10;
selectcount(1) replied_root_id10_total_num from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =10
-- 11 select*from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =11 orderby create_at desc limit 10;
selectcount(1) replied_root_id10_total_num from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =11
-- 12 select*from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =12 orderby create_at desc limit 10;
selectcount(1) replied_root_id10_total_num from Comment where content ='知识' and (from_user_name ='soul11201'or to_user_name ='soul11201') and replied_root_id =12
/** * Execute the query as a "select" statement. * * @param array $columns * @return \Illuminate\Database\Eloquent\Collection|static[] */ publicfunctionget($columns = ['*']) { //应用其他注入构造条件 $builder = $this->applyScopes();
// If we actually found models we will also eager load any relationships that // have been specified as needing to be eager loaded, which will solve the // n+1 query issue for the developers to avoid running a lot of queries. if (count($models = $builder->getModels($columns)) > 0) { $models = $builder->eagerLoadRelations($models); }