where('cp_name','like',"%{$cpName}%"); } return $list->get(); } /** * 查询产品列表 * name: getCpList * @param $where * @param int $pageSize * @return LengthAwarePaginator * date 2023/03/22 20:49 */ public static function getCpList($where , int $pageSize = 20) { $list = DB::table('cps')->where($where)->orderBy('cp_id','desc')->paginate($pageSize); if(!$list->isEmpty()){ foreach ($list as $value){ $value->book_count = 0; } } return $list; } }