$params['system_name'], 'system_url' => $params['system_url'], 'system_appid' => create_appid(), 'system_appkey' => create_appkey(), 'system_status' => 0, ]); return true; }catch (\Exception $e) { self::setError($e->getMessage()); return false; } } //删除 public static function delete(array $params): bool { try { System::update([ 'id' => $params['id'], 'system_status' => 2, 'update_time' => time() ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } //修改 public static function edit(array $params) : bool { try { System::update([ 'id' => $params['id'], 'system_name' => $params['system_name'], 'system_url' => $params['system_url'], 'system_status' => $params['system_status'], 'update_time' => time() ]); return true; } catch (\Exception $e) { self::setError($e->getMessage()); return false; } } // 查看 public static function detail($params) : array { $data = System::field('id,system_name,system_appid,system_appkey,system_url,system_status,system_type,create_time')->findOrEmpty($params['id']); $data['system_status_text'] = $data->system_status_text; return $data->toArray(); } }