0, 'data' => []])); } $goods_model = model('goods'); $course = array_slice($goods_model->getSearch($name, 'goods_id,goods_name,gc_id,ke_simple_college',764),0 , 10); foreach ($course as &$val) { $val['url'] = '/Goods?goods_id='.$val['goods_id']; $val['ke_college'] = $val['ke_simple_college']; } /* $program = array_slice($goods_model->getSearch($name, 'goods_id,goods_name,gc_id,ke_simple_college',765),0 , 10); foreach ($program as &$val) { $val['url'] = '/Goods/program?gc_id='.$val['gc_id']; $val['ke_college'] = $val['ke_simple_college']; }*/ $program = []; $data = [ 'course' => $course, 'program' => $program, ]; exit(json_encode(['status'=>0, 'data' => $data])); } }