1,第一步获取前端页面传过来的数据
2,编写where条件数组
$input=input(“name”);
2,编写where条件数组 编写的时候注意数组格式 ,这里就直接上图了
数组条件可以替换成自己需要的条件,我这里用的都是模糊查询
3, 使用 多条件whereOr 进行查询
$ list=Db::table(‘company_account’)->whereOr($where) ->select();
4,获取数据查询长度
$ count=count($list);
5,返回数据
return json([‘code’=>200,‘data’ => $list,‘count’ => $count]);
上原图