first(); if(empty($info) || $info === false) { $params['config_name'] = 'h5'; $result = H5Config::insertGetId($params); H5Config::affairCommit(); return true; }else{ $result = H5Config::where('config_name','h5')->update($params); H5Config::affairCommit(); return true; } throw new \Exception('操作失败!'); }catch (\Exception $exception){ H5Config::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } }