select('identity', 'infoname', 'infocontent', 'extinfo', 'remarks', 'status', 'infotype') ->whereIn('infotype', array(0, 24)) ->get(); if ($data && count($data->toArray()) > 0) Render($data->toArray(), 1); Render('', -5201); } function DefaultInfo() { $cache = C()->get('cache')->get('DefaultInfo'); if(!empty($cache)) Render(json_decode($cache,1)); //--Bruce--合并接口 $info = lm('setinfo', 'commons')->whereIn('infotype', [2004, 2001, 1017, 24,100,20060])->orderBy('infotype', 'desc')->get(['identity', 'infoname', 'infocontent', 'extinfo', 'remarks', 'status', 'infotype']); if (!$info) { Render('', -5201); } // $infodata = []; // foreach ($info as $v) { // if (in_array($v['infotype'], [2001, 2004, 1017])) { // $infodata[$v['remarks']] = $v['infocontent']; // } else { // $infodata[] = $v; // } // } $ret =array_column($info->toarray(),'infocontent','remarks'); C()->get('cache')->set('DefaultInfo',json_encode($ret),600); Render($ret, 1); } }